Built with
Alectryon , running Coq+SerAPI v8.15.0+0.15.0. Bubbles (
) indicate interactive fragments: hover for details, tap to reveal contents. Use
Ctrl+↑ Ctrl+↓ to navigate,
Ctrl+🖱️ to focus. On Mac, use
⌘ instead of
Ctrl .
From Coq Require Import ssreflect ssrfun ssrbool.
From stdpp Require Import base tactics sets.New coercion path [Bool.Is_true] : bool >-> Sortclass is ambiguous with existing
[is_true] : bool >-> Sortclass .
[ambiguous-paths,typechecker] New coercion path [Is_true] : bool >-> Sortclass is ambiguous with existing
[is_true] : bool >-> Sortclass .
[ambiguous-paths,typechecker]
Require Import MatchingLogic.Utils.extralibrary. (* compare_nat *)
From MatchingLogic Require Import
Pattern.
Section subst .
Context {Σ : Signature}.
(* There are two substitution operations over patterns, [bevar_subst] and [bsvar_subst]. *)
(* substitute bound variable x for psi in phi *)
Fixpoint bevar_subst (psi : Pattern) (x : db_index) (phi : Pattern) :=
match phi with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar n => match compare_nat n x with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end
| patt_bound_svar n => patt_bound_svar n
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 => patt_app (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 => patt_imp (bevar_subst psi x phi1) (bevar_subst psi x phi2)
| patt_exists phi' => patt_exists (bevar_subst psi (S x) phi')
| patt_mu phi' => patt_mu (bevar_subst psi x phi')
end .
Fixpoint bsvar_subst (psi : Pattern) (x : db_index) (phi : Pattern) :=
match phi with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar n => patt_bound_evar n
| patt_bound_svar n => match compare_nat n x with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 => patt_app (bsvar_subst psi x phi1)
(bsvar_subst psi x phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 => patt_imp (bsvar_subst psi x phi1) (bsvar_subst psi x phi2)
| patt_exists phi' => patt_exists (bsvar_subst psi x phi')
| patt_mu phi' => patt_mu (bsvar_subst psi(S x) phi')
end .
Fixpoint bevar_occur (phi : Pattern) (x : db_index) : bool :=
match phi with
| patt_free_evar x' => false
| patt_free_svar x' => false
| patt_bound_evar n => if decide (n = x) is left _ then true else false
| patt_bound_svar n => false
| patt_sym sigma => false
| patt_app phi1 phi2 => orb (bevar_occur phi1 x)
(bevar_occur phi2 x)
| patt_bott => false
| patt_imp phi1 phi2 => orb (bevar_occur phi1 x) (bevar_occur phi2 x)
| patt_exists phi' => bevar_occur phi' (S x)
| patt_mu phi' => bevar_occur phi' x
end .
Fixpoint bsvar_occur (phi : Pattern) (x : db_index) : bool :=
match phi with
| patt_free_evar x' => false
| patt_free_svar x' => false
| patt_bound_evar n => false
| patt_bound_svar n => if (decide (n = x)) is left _ then true else false
| patt_sym sigma => false
| patt_app phi1 phi2 => orb (bsvar_occur phi1 x)
(bsvar_occur phi2 x)
| patt_bott => false
| patt_imp phi1 phi2 => orb (bsvar_occur phi1 x) (bsvar_occur phi2 x)
| patt_exists phi' => bsvar_occur phi' x
| patt_mu phi' => bsvar_occur phi' (S x)
end .
(* substitute free element variable x for psi in phi *)
Fixpoint free_evar_subst (psi : Pattern) (x : evar ) (phi : Pattern) :=
match phi with
| patt_free_evar x' => if decide (x = x') is left _ then psi else patt_free_evar x'
| patt_free_svar X => patt_free_svar X
| patt_bound_evar x' => patt_bound_evar x'
| patt_bound_svar X => patt_bound_svar X
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 => patt_app (free_evar_subst psi x phi1)
(free_evar_subst psi x phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 => patt_imp (free_evar_subst psi x phi1) (free_evar_subst psi x phi2)
| patt_exists phi' => patt_exists (free_evar_subst psi x phi')
| patt_mu phi' => patt_mu (free_evar_subst psi x phi')
end .
(* substitute free set variable X for psi in phi *)
Fixpoint free_svar_subst (psi : Pattern) (X : svar) (phi : Pattern) : Pattern :=
match phi with
| patt_free_evar x => patt_free_evar x
| patt_free_svar X' => if decide (X = X') is left _ then psi else patt_free_svar X'
| patt_bound_evar x => patt_bound_evar x
| patt_bound_svar X' => patt_bound_svar X'
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 => patt_app (free_svar_subst psi X phi1)
(free_svar_subst psi X phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 => patt_imp (free_svar_subst psi X phi1) (free_svar_subst psi X phi2)
| patt_exists phi' => patt_exists (free_svar_subst psi X phi')
| patt_mu phi' => patt_mu (free_svar_subst psi X phi')
end .
(* instantiate exists x. p or mu x. p with psi for p *)
Definition instantiate (phi psi : Pattern) :=
match phi with
| patt_exists phi' => bevar_subst psi 0 phi'
| patt_mu phi' => bsvar_subst psi 0 phi'
| _ => phi
end .
(* replace element variable x with de Bruijn index level *)
Fixpoint evar_quantify (x : evar ) (level : db_index)
(p : Pattern) : Pattern :=
match p with
| patt_free_evar x' => if decide (x = x') is left _ then patt_bound_evar level else patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar x' => patt_bound_evar x'
| patt_bound_svar X => patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs => patt_app (evar_quantify x level ls) (evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs => patt_imp (evar_quantify x level ls) (evar_quantify x level rs)
| patt_exists p' => patt_exists (evar_quantify x (S level) p')
| patt_mu p' => patt_mu (evar_quantify x level p')
end .
(* replace set variable X with de Bruijn index level *)
Fixpoint svar_quantify (X : svar) (level : db_index)
(p : Pattern) : Pattern :=
match p with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar X' => if decide (X = X') is left _ then patt_bound_svar level else patt_free_svar X'
| patt_bound_evar x' => patt_bound_evar x'
| patt_bound_svar X => patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs => patt_app (svar_quantify X level ls) (svar_quantify X level rs)
| patt_bott => patt_bott
| patt_imp ls rs => patt_imp (svar_quantify X level ls) (svar_quantify X level rs)
| patt_exists p' => patt_exists (svar_quantify X level p')
| patt_mu p' => patt_mu (svar_quantify X (S level) p')
end .
(* replace de Bruijn index k with element variable n *)
Definition evar_open (x : evar ) (k : db_index) (p : Pattern) : Pattern :=
bevar_subst (patt_free_evar x) k p.
(* replace de Bruijn index k with set variable n *)
Definition svar_open (X : svar) (k : db_index) (p : Pattern) : Pattern :=
bsvar_subst (patt_free_svar X) k p.
End subst .
Module Notations .
Declare Scope ml_scope.
Delimit Scope ml_scope with ml.
Notation "e ^[ 'evar:' dbi ↦ e' ]" := (bevar_subst e' dbi e) (at level 2 , e' at level 200 , left associativity ,
format "e ^[ 'evar:' dbi ↦ e' ]" ) : ml_scope.
Notation "e ^[ 'svar:' dbi ↦ e' ]" := (bsvar_subst e' dbi e) (at level 2 , e' at level 200 , left associativity ,
format "e ^[ 'svar:' dbi ↦ e' ]" ) : ml_scope.
Notation "e ^[[ 'evar:' x ↦ e' ]]" := (free_evar_subst e' x e) (at level 2 , e' at level 200 , left associativity ,
format "e ^[[ 'evar:' x ↦ e' ]]" ) : ml_scope.
Notation "e ^[[ 'svar:' X ↦ e' ]]" := (free_svar_subst e' X e) (at level 2 , e' at level 200 , left associativity ,
format "e ^[[ 'svar:' X ↦ e' ]]" ) : ml_scope.
Notation "e ^{ 'evar:' db ↦ x }" := (evar_open x db e) (at level 2 , x at level 200 , left associativity ,
format "e ^{ 'evar:' db ↦ x }" ) : ml_scope.
Notation "e ^{ 'svar:' db ↦ x }" := (svar_open x db e) (at level 2 , x at level 200 , left associativity ,
format "e ^{ 'svar:' db ↦ x }" ) : ml_scope.
Notation "e ^{{ 'evar:' x ↦ db }}" := (evar_quantify x db e) (at level 2 , x at level 200 , left associativity ,
format "e ^{{ 'evar:' x ↦ db }}" ) : ml_scope.
Notation "e ^{{ 'svar:' x ↦ db }}" := (svar_quantify x db e) (at level 2 , x at level 200 , left associativity ,
format "e ^{{ 'svar:' x ↦ db }}" ) : ml_scope.
Notation "e ^ [ e' ]" := (instantiate e e') (at level 2 , e' at level 200 , left associativity ) : ml_scope.
End Notations .
Section subst .
Import Notations.
Open Scope ml_scope.
Context {Σ : Signature}.
Definition exists_quantify (x : evar )
(p : Pattern) : Pattern :=
patt_exists (p^{{evar : x ↦ 0 }}).
Definition mu_quantify (X : svar)
(p : Pattern) : Pattern :=
patt_mu (p^{{svar: X ↦ 0 }}).
Lemma evar_open_size :
forall (k : db_index) (n : evar ) (p : Pattern),
size p = size (p^{evar : k ↦ n}).Σ : Signature
∀ (k : db_index) (n : evar ) (p : Pattern),
size p = size p^{evar :k↦n}
Proof .Σ : Signature
∀ (k : db_index) (n : evar ) (p : Pattern),
size p = size p^{evar :k↦n}
intros k n p.Σ : Signature k : db_index n : evar p : Pattern
size p = size p^{evar :k↦n}
generalize dependent k.Σ : Signature n : evar p : Pattern
∀ k : db_index, size p = size p^{evar :k↦n}
induction p; intros k; cbn ; try reflexivity .Σ : Signature n : evar n0, k : db_index
0 =
size
match compare_nat n0 k with
| Nat_less _ _ _ => patt_bound_evar n0
| Nat_equal _ _ _ => patt_free_evar n
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n0)
end
break_match_goal; reflexivity . Σ : Signature n : evar p1, p2 : Pattern IHp1 : ∀ k : db_index, size p1 = size p1^{evar :k↦n}IHp2 : ∀ k : db_index, size p2 = size p2^{evar :k↦n}k : db_index
S (size p1 + size p2) =
S
(size p1^[evar :k↦patt_free_evar n] +
size p2^[evar :k↦patt_free_evar n])
rewrite (IHp1 k); rewrite (IHp2 k); reflexivity .Σ : Signature n : evar p1, p2 : Pattern IHp1 : ∀ k : db_index, size p1 = size p1^{evar :k↦n}IHp2 : ∀ k : db_index, size p2 = size p2^{evar :k↦n}k : db_index
S (size p1 + size p2) =
S
(size p1^[evar :k↦patt_free_evar n] +
size p2^[evar :k↦patt_free_evar n])
rewrite (IHp1 k); rewrite (IHp2 k); reflexivity .Σ : Signature n : evar p : Pattern IHp : ∀ k : db_index, size p = size p^{evar :k↦n}k : db_index
S (size p) = S (size p^[evar :S k↦patt_free_evar n])
rewrite (IHp (S k)); reflexivity .Σ : Signature n : evar p : Pattern IHp : ∀ k : db_index, size p = size p^{evar :k↦n}k : db_index
S (size p) = S (size p^[evar :k↦patt_free_evar n])
rewrite (IHp k); reflexivity .
Qed .
Lemma svar_open_size :
forall (k : db_index) (n : svar) (p : Pattern),
size p = size (p^{svar: k ↦ n}).Σ : Signature
∀ (k : db_index) (n : svar) (p : Pattern),
size p = size p^{svar:k↦n}
Proof .Σ : Signature
∀ (k : db_index) (n : svar) (p : Pattern),
size p = size p^{svar:k↦n}
intros k n p.Σ : Signature k : db_index n : svar p : Pattern
size p = size p^{svar:k↦n}
generalize dependent k.Σ : Signature n : svar p : Pattern
∀ k : db_index, size p = size p^{svar:k↦n}
induction p; intros k; cbn ; try reflexivity .Σ : Signature n : svar n0, k : db_index
0 =
size
match compare_nat n0 k with
| Nat_less _ _ _ => patt_bound_svar n0
| Nat_equal _ _ _ => patt_free_svar n
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n0)
end
break_match_goal; reflexivity . Σ : Signature n : svar p1, p2 : Pattern IHp1 : ∀ k : db_index, size p1 = size p1^{svar:k↦n}IHp2 : ∀ k : db_index, size p2 = size p2^{svar:k↦n}k : db_index
S (size p1 + size p2) =
S
(size p1^[svar:k↦patt_free_svar n] +
size p2^[svar:k↦patt_free_svar n])
rewrite (IHp1 k); rewrite (IHp2 k); reflexivity .Σ : Signature n : svar p1, p2 : Pattern IHp1 : ∀ k : db_index, size p1 = size p1^{svar:k↦n}IHp2 : ∀ k : db_index, size p2 = size p2^{svar:k↦n}k : db_index
S (size p1 + size p2) =
S
(size p1^[svar:k↦patt_free_svar n] +
size p2^[svar:k↦patt_free_svar n])
rewrite (IHp1 k); rewrite (IHp2 k); reflexivity .Σ : Signature n : svar p : Pattern IHp : ∀ k : db_index, size p = size p^{svar:k↦n}k : db_index
S (size p) = S (size p^[svar:k↦patt_free_svar n])
rewrite (IHp k); reflexivity .Σ : Signature n : svar p : Pattern IHp : ∀ k : db_index, size p = size p^{svar:k↦n}k : db_index
S (size p) = S (size p^[svar:S k↦patt_free_svar n])
rewrite (IHp (S k)); reflexivity .
Qed .
(* From https://www.chargueraud.org/research/2009/ln/main.pdf in 3.3 (body def.) *)
Definition wfc_body_ex phi := forall x ,
~ elem_of x (free_evars phi) -> well_formed_closed (phi^{evar : 0 ↦ x}) = true.
Lemma positive_negative_occurrence_evar_open_and : forall (phi : Pattern) (db1 db2 : db_index) (x : evar ),
(*le db1 db2 ->*)
(no_positive_occurrence_db_b db1 phi -> no_positive_occurrence_db_b db1 (phi^{evar : db2 ↦ x}))
/\ (no_negative_occurrence_db_b db1 phi -> no_negative_occurrence_db_b db1 (phi^{evar : db2 ↦ x})).Σ : Signature
∀ (phi : Pattern) (db1 db2 : db_index) (x : evar ),
(no_positive_occurrence_db_b db1 phi
→ no_positive_occurrence_db_b db1 phi^{evar :db2↦x})
∧ (no_negative_occurrence_db_b db1 phi
→ no_negative_occurrence_db_b db1
phi^{evar :db2↦x})
Proof .Σ : Signature
∀ (phi : Pattern) (db1 db2 : db_index) (x : evar ),
(no_positive_occurrence_db_b db1 phi
→ no_positive_occurrence_db_b db1 phi^{evar :db2↦x})
∧ (no_negative_occurrence_db_b db1 phi
→ no_negative_occurrence_db_b db1
phi^{evar :db2↦x})
induction phi; intros db1 db2 x'; cbn ; split ; intro H; try lia ; auto .Σ : Signature n, db1, db2 : db_index x' : evar H : true
no_positive_occurrence_db_b db1
match compare_nat n db2 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x'
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end
* Σ : Signature n, db1, db2 : db_index x' : evar H : true
no_positive_occurrence_db_b db1
match compare_nat n db2 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x'
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end
case_match; auto .
* Σ : Signature n, db1, db2 : db_index x' : evar H : true
no_negative_occurrence_db_b db1
match compare_nat n db2 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x'
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end
case_match; auto .
* Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_positive_occurrence_db_b db1 phi1
→ no_positive_occurrence_db_b db1
phi1^{evar :db2↦x})
∧ (no_negative_occurrence_db_b db1 phi1
→ no_negative_occurrence_db_b db1
phi1^{evar :db2↦x})IHphi2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_positive_occurrence_db_b db1 phi2
→ no_positive_occurrence_db_b db1
phi2^{evar :db2↦x})
∧ (no_negative_occurrence_db_b db1 phi2
→ no_negative_occurrence_db_b db1
phi2^{evar :db2↦x})db1, db2 : db_index x' : evar H : no_positive_occurrence_db_b db1 phi1 &&
no_positive_occurrence_db_b db1 phi2
no_positive_occurrence_db_b db1
phi1^[evar :db2↦patt_free_evar x'] &&
no_positive_occurrence_db_b db1
phi2^[evar :db2↦patt_free_evar x']
rewrite -> (proj1 (IHphi1 db1 db2 x')), -> (proj1 (IHphi2 db1 db2 x')); destruct_and!; auto .
* Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_positive_occurrence_db_b db1 phi1
→ no_positive_occurrence_db_b db1
phi1^{evar :db2↦x})
∧ (no_negative_occurrence_db_b db1 phi1
→ no_negative_occurrence_db_b db1
phi1^{evar :db2↦x})IHphi2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_positive_occurrence_db_b db1 phi2
→ no_positive_occurrence_db_b db1
phi2^{evar :db2↦x})
∧ (no_negative_occurrence_db_b db1 phi2
→ no_negative_occurrence_db_b db1
phi2^{evar :db2↦x})db1, db2 : db_index x' : evar H : no_negative_occurrence_db_b db1 phi1 &&
no_negative_occurrence_db_b db1 phi2
no_negative_occurrence_db_b db1
phi1^[evar :db2↦patt_free_evar x'] &&
no_negative_occurrence_db_b db1
phi2^[evar :db2↦patt_free_evar x']
rewrite -> (proj2 (IHphi1 db1 db2 x')), -> (proj2 (IHphi2 db1 db2 x')); destruct_and!; auto .
* Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_positive_occurrence_db_b db1 phi1
→ no_positive_occurrence_db_b db1
phi1^{evar :db2↦x})
∧ (no_negative_occurrence_db_b db1 phi1
→ no_negative_occurrence_db_b db1
phi1^{evar :db2↦x})IHphi2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_positive_occurrence_db_b db1 phi2
→ no_positive_occurrence_db_b db1
phi2^{evar :db2↦x})
∧ (no_negative_occurrence_db_b db1 phi2
→ no_negative_occurrence_db_b db1
phi2^{evar :db2↦x})db1, db2 : db_index x' : evar H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) db1 phi1 &&
no_positive_occurrence_db_b db1 phi2
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) db1
phi1^[evar :db2↦patt_free_evar x'] &&
no_positive_occurrence_db_b db1
phi2^[evar :db2↦patt_free_evar x']
rewrite -> (proj2 (IHphi1 db1 db2 x')), -> (proj1 (IHphi2 db1 db2 x')); destruct_and!; auto .
* Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_positive_occurrence_db_b db1 phi1
→ no_positive_occurrence_db_b db1
phi1^{evar :db2↦x})
∧ (no_negative_occurrence_db_b db1 phi1
→ no_negative_occurrence_db_b db1
phi1^{evar :db2↦x})IHphi2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_positive_occurrence_db_b db1 phi2
→ no_positive_occurrence_db_b db1
phi2^{evar :db2↦x})
∧ (no_negative_occurrence_db_b db1 phi2
→ no_negative_occurrence_db_b db1
phi2^{evar :db2↦x})db1, db2 : db_index x' : evar H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) db1 phi1 &&
no_negative_occurrence_db_b db1 phi2
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) db1
phi1^[evar :db2↦patt_free_evar x'] &&
no_negative_occurrence_db_b db1
phi2^[evar :db2↦patt_free_evar x']
rewrite -> (proj1 (IHphi1 db1 db2 x')), -> (proj2 (IHphi2 db1 db2 x')); destruct_and!; auto .
* Σ : Signature phi : Pattern IHphi : ∀ (db1 db2 : db_index) (x : evar ),
(no_positive_occurrence_db_b db1 phi
→ no_positive_occurrence_db_b db1
phi^{evar :db2↦x})
∧ (no_negative_occurrence_db_b db1 phi
→ no_negative_occurrence_db_b db1
phi^{evar :db2↦x})db1, db2 : db_index x' : evar H : no_positive_occurrence_db_b db1 phi
no_positive_occurrence_db_b db1
phi^[evar :S db2↦patt_free_evar x']
rewrite -> (proj1 (IHphi db1 (S db2) x')); auto .
* Σ : Signature phi : Pattern IHphi : ∀ (db1 db2 : db_index) (x : evar ),
(no_positive_occurrence_db_b db1 phi
→ no_positive_occurrence_db_b db1
phi^{evar :db2↦x})
∧ (no_negative_occurrence_db_b db1 phi
→ no_negative_occurrence_db_b db1
phi^{evar :db2↦x})db1, db2 : db_index x' : evar H : no_negative_occurrence_db_b db1 phi
no_negative_occurrence_db_b db1
phi^[evar :S db2↦patt_free_evar x']
rewrite -> (proj2 (IHphi db1 (S db2) x')); auto .
* Σ : Signature phi : Pattern IHphi : ∀ (db1 db2 : db_index) (x : evar ),
(no_positive_occurrence_db_b db1 phi
→ no_positive_occurrence_db_b db1
phi^{evar :db2↦x})
∧ (no_negative_occurrence_db_b db1 phi
→ no_negative_occurrence_db_b db1
phi^{evar :db2↦x})db1, db2 : db_index x' : evar H : no_positive_occurrence_db_b (S db1) phi
no_positive_occurrence_db_b (S db1)
phi^[evar :db2↦patt_free_evar x']
rewrite -> (proj1 (IHphi (S db1) db2 x')); auto .
* Σ : Signature phi : Pattern IHphi : ∀ (db1 db2 : db_index) (x : evar ),
(no_positive_occurrence_db_b db1 phi
→ no_positive_occurrence_db_b db1
phi^{evar :db2↦x})
∧ (no_negative_occurrence_db_b db1 phi
→ no_negative_occurrence_db_b db1
phi^{evar :db2↦x})db1, db2 : db_index x' : evar H : no_negative_occurrence_db_b (S db1) phi
no_negative_occurrence_db_b (S db1)
phi^[evar :db2↦patt_free_evar x']
rewrite -> (proj2 (IHphi (S db1) db2 x')); auto .
Qed .
Lemma no_negative_occurrence_evar_open phi db1 db2 x :
no_negative_occurrence_db_b db1 phi = true ->
no_negative_occurrence_db_b db1 (phi^{evar : db2 ↦ x}) = true.Σ : Signature phi : Pattern db1, db2 : db_index x : evar
no_negative_occurrence_db_b db1 phi = true
→ no_negative_occurrence_db_b db1 phi^{evar :db2↦x} =
true
Proof .Σ : Signature phi : Pattern db1, db2 : db_index x : evar
no_negative_occurrence_db_b db1 phi = true
→ no_negative_occurrence_db_b db1 phi^{evar :db2↦x} =
true
apply positive_negative_occurrence_evar_open_and.
Qed .
Lemma no_positive_occurrence_evar_open phi db1 db2 x :
no_positive_occurrence_db_b db1 phi = true ->
no_positive_occurrence_db_b db1 (phi^{evar : db2 ↦ x}) = true.Σ : Signature phi : Pattern db1, db2 : db_index x : evar
no_positive_occurrence_db_b db1 phi = true
→ no_positive_occurrence_db_b db1 phi^{evar :db2↦x} =
true
Proof .Σ : Signature phi : Pattern db1, db2 : db_index x : evar
no_positive_occurrence_db_b db1 phi = true
→ no_positive_occurrence_db_b db1 phi^{evar :db2↦x} =
true
apply positive_negative_occurrence_evar_open_and.
Qed .
(*Helper lemma for wf_body_to_wf_ex*)
Lemma wfc_ex_aux_body_ex_imp2 :
forall phi n x ,
well_formed_closed_ex_aux (phi^{evar : n ↦ x}) n = true
->
well_formed_closed_ex_aux phi (S n) = true.Σ : Signature
∀ (phi : Pattern) (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi^{evar :n↦x} n = true
→ well_formed_closed_ex_aux phi (S n) = true
Proof using .Σ : Signature
∀ (phi : Pattern) (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi^{evar :n↦x} n = true
→ well_formed_closed_ex_aux phi (S n) = true
induction phi; firstorder .Σ : Signature n, n0 : db_index x : evar H : well_formed_closed_ex_aux
(patt_bound_evar n)^{evar :n0↦x} n0 = true
well_formed_closed_ex_aux (patt_bound_evar n) (S n0) =
true
- Σ : Signature n, n0 : db_index x : evar H : well_formed_closed_ex_aux
(patt_bound_evar n)^{evar :n0↦x} n0 = true
well_formed_closed_ex_aux (patt_bound_evar n) (S n0) =
true
simpl .Σ : Signature n, n0 : db_index x : evar H : well_formed_closed_ex_aux
(patt_bound_evar n)^{evar :n0↦x} n0 = true
(if decide (n < S n0) then true else false) = true
cbn in H.Σ : Signature n, n0 : db_index x : evar H : well_formed_closed_ex_aux
match compare_nat n n0 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end n0 = true
(if decide (n < S n0) then true else false) = true
unfold well_formed_closed_ex_aux.Σ : Signature n, n0 : db_index x : evar H : well_formed_closed_ex_aux
match compare_nat n n0 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end n0 = true
(if decide (n < S n0) then true else false) = true
repeat case_match; simpl ; auto ; try lia .Σ : Signature n, n0 : db_index x : evar g : n > n0 H0 : compare_nat n n0 = Nat_greater n n0 g H : well_formed_closed_ex_aux
(patt_bound_evar (Nat.pred n)) n0 = true n1 : ¬ n < S n0 H1 : decide (n < S n0) = right n1
false = true
unfold well_formed_closed_ex_aux in H.Σ : Signature n, n0 : db_index x : evar g : n > n0 H0 : compare_nat n n0 = Nat_greater n n0 g H : (if decide (Nat.pred n < n0) then true else false) =
true n1 : ¬ n < S n0 H1 : decide (n < S n0) = right n1
false = true
case_match; auto . Σ : Signature n, n0 : db_index x : evar g : n > n0 H0 : compare_nat n n0 = Nat_greater n n0 g l : Nat.pred n < n0 H2 : decide (Nat.pred n < n0) = left l H : true = true n1 : ¬ n < S n0 H1 : decide (n < S n0) = right n1
false = true
lia .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H : well_formed_closed_ex_aux
(patt_app phi1 phi2)^{evar :n↦x} n = true
well_formed_closed_ex_aux (patt_app phi1 phi2) (S n) =
true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H : well_formed_closed_ex_aux
phi1^[evar :n↦patt_free_evar x] n &&
well_formed_closed_ex_aux
phi2^[evar :n↦patt_free_evar x] n = true
well_formed_closed_ex_aux (patt_app phi1 phi2) (S n) =
true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H : well_formed_closed_ex_aux
phi1^[evar :n↦patt_free_evar x] n &&
well_formed_closed_ex_aux
phi2^[evar :n↦patt_free_evar x] n = true
well_formed_closed_ex_aux phi1 (S n) &&
well_formed_closed_ex_aux phi2 (S n) = true
apply andb_true_iff in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H : well_formed_closed_ex_aux
phi1^[evar :n↦patt_free_evar x] n = true
∧ well_formed_closed_ex_aux
phi2^[evar :n↦patt_free_evar x] n = true
well_formed_closed_ex_aux phi1 (S n) &&
well_formed_closed_ex_aux phi2 (S n) = true
destruct H as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H1 : well_formed_closed_ex_aux
phi1^[evar :n↦patt_free_evar x] n = true H2 : well_formed_closed_ex_aux
phi2^[evar :n↦patt_free_evar x] n = true
well_formed_closed_ex_aux phi1 (S n) &&
well_formed_closed_ex_aux phi2 (S n) = true
erewrite IHphi1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H1 : well_formed_closed_ex_aux
phi1^[evar :n↦patt_free_evar x] n = true H2 : well_formed_closed_ex_aux
phi2^[evar :n↦patt_free_evar x] n = true
true && well_formed_closed_ex_aux phi2 (S n) = true
2 : apply H1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H1 : well_formed_closed_ex_aux
phi1^[evar :n↦patt_free_evar x] n = true H2 : well_formed_closed_ex_aux
phi2^[evar :n↦patt_free_evar x] n = true
true && well_formed_closed_ex_aux phi2 (S n) = true
erewrite IHphi2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H1 : well_formed_closed_ex_aux
phi1^[evar :n↦patt_free_evar x] n = true H2 : well_formed_closed_ex_aux
phi2^[evar :n↦patt_free_evar x] n = true
true && true = true
2 : apply H2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H1 : well_formed_closed_ex_aux
phi1^[evar :n↦patt_free_evar x] n = true H2 : well_formed_closed_ex_aux
phi2^[evar :n↦patt_free_evar x] n = true
true && true = true
reflexivity .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H : well_formed_closed_ex_aux
(patt_imp phi1 phi2)^{evar :n↦x} n = true
well_formed_closed_ex_aux (patt_imp phi1 phi2) (S n) =
true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H : well_formed_closed_ex_aux
phi1^[evar :n↦patt_free_evar x] n &&
well_formed_closed_ex_aux
phi2^[evar :n↦patt_free_evar x] n = true
well_formed_closed_ex_aux (patt_imp phi1 phi2) (S n) =
true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H : well_formed_closed_ex_aux
phi1^[evar :n↦patt_free_evar x] n &&
well_formed_closed_ex_aux
phi2^[evar :n↦patt_free_evar x] n = true
well_formed_closed_ex_aux phi1 (S n) &&
well_formed_closed_ex_aux phi2 (S n) = true
apply andb_true_iff in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H : well_formed_closed_ex_aux
phi1^[evar :n↦patt_free_evar x] n = true
∧ well_formed_closed_ex_aux
phi2^[evar :n↦patt_free_evar x] n = true
well_formed_closed_ex_aux phi1 (S n) &&
well_formed_closed_ex_aux phi2 (S n) = true
destruct H as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H1 : well_formed_closed_ex_aux
phi1^[evar :n↦patt_free_evar x] n = true H2 : well_formed_closed_ex_aux
phi2^[evar :n↦patt_free_evar x] n = true
well_formed_closed_ex_aux phi1 (S n) &&
well_formed_closed_ex_aux phi2 (S n) = true
erewrite IHphi1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H1 : well_formed_closed_ex_aux
phi1^[evar :n↦patt_free_evar x] n = true H2 : well_formed_closed_ex_aux
phi2^[evar :n↦patt_free_evar x] n = true
true && well_formed_closed_ex_aux phi2 (S n) = true
2 : apply H1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H1 : well_formed_closed_ex_aux
phi1^[evar :n↦patt_free_evar x] n = true H2 : well_formed_closed_ex_aux
phi2^[evar :n↦patt_free_evar x] n = true
true && well_formed_closed_ex_aux phi2 (S n) = true
erewrite IHphi2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H1 : well_formed_closed_ex_aux
phi1^[evar :n↦patt_free_evar x] n = true H2 : well_formed_closed_ex_aux
phi2^[evar :n↦patt_free_evar x] n = true
true && true = true
2 : apply H2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi1^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (x : evar ),
well_formed_closed_ex_aux phi2^{evar :n↦x} n =
true
→ well_formed_closed_ex_aux phi2 (S n) =
truen : db_index x : evar H1 : well_formed_closed_ex_aux
phi1^[evar :n↦patt_free_evar x] n = true H2 : well_formed_closed_ex_aux
phi2^[evar :n↦patt_free_evar x] n = true
true && true = true
reflexivity .
Qed .
(*Helper lemma for wf_body_to_wf_ex*)
Lemma wfc_mu_aux_body_ex_imp2 :
forall phi n n' x ,
well_formed_closed_mu_aux (phi^{evar : n ↦ x}) n' = true
->
well_formed_closed_mu_aux phi n' = true.Σ : Signature
∀ (phi : Pattern) (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi^{evar :n↦x} n' = true
→ well_formed_closed_mu_aux phi n' = true
Proof using .Σ : Signature
∀ (phi : Pattern) (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi^{evar :n↦x} n' = true
→ well_formed_closed_mu_aux phi n' = true
induction phi; firstorder .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H : well_formed_closed_mu_aux
(patt_app phi1 phi2)^{evar :n↦x} n' = true
well_formed_closed_mu_aux (patt_app phi1 phi2) n' =
true
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H : well_formed_closed_mu_aux
(patt_app phi1 phi2)^{evar :n↦x} n' = true
well_formed_closed_mu_aux (patt_app phi1 phi2) n' =
true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H : well_formed_closed_mu_aux
phi1^[evar :n↦patt_free_evar x] n' &&
well_formed_closed_mu_aux
phi2^[evar :n↦patt_free_evar x] n' = true
well_formed_closed_mu_aux (patt_app phi1 phi2) n' =
true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H : well_formed_closed_mu_aux
phi1^[evar :n↦patt_free_evar x] n' &&
well_formed_closed_mu_aux
phi2^[evar :n↦patt_free_evar x] n' = true
well_formed_closed_mu_aux phi1 n' &&
well_formed_closed_mu_aux phi2 n' = true
apply andb_true_iff in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H : well_formed_closed_mu_aux
phi1^[evar :n↦patt_free_evar x] n' = true
∧ well_formed_closed_mu_aux
phi2^[evar :n↦patt_free_evar x] n' = true
well_formed_closed_mu_aux phi1 n' &&
well_formed_closed_mu_aux phi2 n' = true
destruct H as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H1 : well_formed_closed_mu_aux
phi1^[evar :n↦patt_free_evar x] n' = true H2 : well_formed_closed_mu_aux
phi2^[evar :n↦patt_free_evar x] n' = true
well_formed_closed_mu_aux phi1 n' &&
well_formed_closed_mu_aux phi2 n' = true
erewrite IHphi1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H1 : well_formed_closed_mu_aux
phi1^[evar :n↦patt_free_evar x] n' = true H2 : well_formed_closed_mu_aux
phi2^[evar :n↦patt_free_evar x] n' = true
true && well_formed_closed_mu_aux phi2 n' = true
2 : apply H1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H1 : well_formed_closed_mu_aux
phi1^[evar :n↦patt_free_evar x] n' = true H2 : well_formed_closed_mu_aux
phi2^[evar :n↦patt_free_evar x] n' = true
true && well_formed_closed_mu_aux phi2 n' = true
erewrite IHphi2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H1 : well_formed_closed_mu_aux
phi1^[evar :n↦patt_free_evar x] n' = true H2 : well_formed_closed_mu_aux
phi2^[evar :n↦patt_free_evar x] n' = true
true && true = true
2 : apply H2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H1 : well_formed_closed_mu_aux
phi1^[evar :n↦patt_free_evar x] n' = true H2 : well_formed_closed_mu_aux
phi2^[evar :n↦patt_free_evar x] n' = true
true && true = true
reflexivity .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H : well_formed_closed_mu_aux
(patt_imp phi1 phi2)^{evar :n↦x} n' = true
well_formed_closed_mu_aux (patt_imp phi1 phi2) n' =
true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H : well_formed_closed_mu_aux
phi1^[evar :n↦patt_free_evar x] n' &&
well_formed_closed_mu_aux
phi2^[evar :n↦patt_free_evar x] n' = true
well_formed_closed_mu_aux (patt_imp phi1 phi2) n' =
true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H : well_formed_closed_mu_aux
phi1^[evar :n↦patt_free_evar x] n' &&
well_formed_closed_mu_aux
phi2^[evar :n↦patt_free_evar x] n' = true
well_formed_closed_mu_aux phi1 n' &&
well_formed_closed_mu_aux phi2 n' = true
apply andb_true_iff in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H : well_formed_closed_mu_aux
phi1^[evar :n↦patt_free_evar x] n' = true
∧ well_formed_closed_mu_aux
phi2^[evar :n↦patt_free_evar x] n' = true
well_formed_closed_mu_aux phi1 n' &&
well_formed_closed_mu_aux phi2 n' = true
destruct H as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H1 : well_formed_closed_mu_aux
phi1^[evar :n↦patt_free_evar x] n' = true H2 : well_formed_closed_mu_aux
phi2^[evar :n↦patt_free_evar x] n' = true
well_formed_closed_mu_aux phi1 n' &&
well_formed_closed_mu_aux phi2 n' = true
erewrite IHphi1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H1 : well_formed_closed_mu_aux
phi1^[evar :n↦patt_free_evar x] n' = true H2 : well_formed_closed_mu_aux
phi2^[evar :n↦patt_free_evar x] n' = true
true && well_formed_closed_mu_aux phi2 n' = true
2 : apply H1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H1 : well_formed_closed_mu_aux
phi1^[evar :n↦patt_free_evar x] n' = true H2 : well_formed_closed_mu_aux
phi2^[evar :n↦patt_free_evar x] n' = true
true && well_formed_closed_mu_aux phi2 n' = true
erewrite IHphi2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H1 : well_formed_closed_mu_aux
phi1^[evar :n↦patt_free_evar x] n' = true H2 : well_formed_closed_mu_aux
phi2^[evar :n↦patt_free_evar x] n' = true
true && true = true
2 : apply H2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi1^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi2^{evar :n↦x}
n' = true
→ well_formed_closed_mu_aux phi2 n' = truen, n' : db_index x : evar H1 : well_formed_closed_mu_aux
phi1^[evar :n↦patt_free_evar x] n' = true H2 : well_formed_closed_mu_aux
phi2^[evar :n↦patt_free_evar x] n' = true
true && true = true
reflexivity .
Qed .
Lemma wfc_ex_aux_body_mu_imp2 :
forall phi n n' X ,
well_formed_closed_ex_aux (phi^{svar: n ↦ X}) n' = true
->
well_formed_closed_ex_aux phi n' = true.Σ : Signature
∀ (phi : Pattern) (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi^{svar:n↦X} n' = true
→ well_formed_closed_ex_aux phi n' = true
Proof using .Σ : Signature
∀ (phi : Pattern) (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi^{svar:n↦X} n' = true
→ well_formed_closed_ex_aux phi n' = true
induction phi; firstorder .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi1^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi2^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi2 n' = truen, n' : db_index X : svar H : well_formed_closed_ex_aux
(patt_app phi1 phi2)^{svar:n↦X} n' = true
well_formed_closed_ex_aux (patt_app phi1 phi2) n' =
true
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi1^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi2^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi2 n' = truen, n' : db_index X : svar H : well_formed_closed_ex_aux
(patt_app phi1 phi2)^{svar:n↦X} n' = true
well_formed_closed_ex_aux (patt_app phi1 phi2) n' =
true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi1^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi2^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi2 n' = truen, n' : db_index X : svar H : well_formed_closed_ex_aux
phi1^[svar:n↦patt_free_svar X] n' &&
well_formed_closed_ex_aux
phi2^[svar:n↦patt_free_svar X] n' = true
well_formed_closed_ex_aux (patt_app phi1 phi2) n' =
true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi1^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi2^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi2 n' = truen, n' : db_index X : svar H : well_formed_closed_ex_aux
phi1^[svar:n↦patt_free_svar X] n' &&
well_formed_closed_ex_aux
phi2^[svar:n↦patt_free_svar X] n' = true
well_formed_closed_ex_aux phi1 n' &&
well_formed_closed_ex_aux phi2 n' = true
destruct_and!. Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi1^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi2^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi2 n' = truen, n' : db_index X : svar H0 : well_formed_closed_ex_aux
phi1^[svar:n↦patt_free_svar X] n' = true H1 : well_formed_closed_ex_aux
phi2^[svar:n↦patt_free_svar X] n' = true
well_formed_closed_ex_aux phi1 n' &&
well_formed_closed_ex_aux phi2 n' = true
erewrite IHphi1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi1^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi2^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi2 n' = truen, n' : db_index X : svar H0 : well_formed_closed_ex_aux
phi1^[svar:n↦patt_free_svar X] n' = true H1 : well_formed_closed_ex_aux
phi2^[svar:n↦patt_free_svar X] n' = true
true && well_formed_closed_ex_aux phi2 n' = true
2 : eassumption .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi1^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi2^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi2 n' = truen, n' : db_index X : svar H0 : well_formed_closed_ex_aux
phi1^[svar:n↦patt_free_svar X] n' = true H1 : well_formed_closed_ex_aux
phi2^[svar:n↦patt_free_svar X] n' = true
true && well_formed_closed_ex_aux phi2 n' = true
erewrite IHphi2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi1^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi2^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi2 n' = truen, n' : db_index X : svar H0 : well_formed_closed_ex_aux
phi1^[svar:n↦patt_free_svar X] n' = true H1 : well_formed_closed_ex_aux
phi2^[svar:n↦patt_free_svar X] n' = true
true && true = true
2 : eassumption .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi1^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi2^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi2 n' = truen, n' : db_index X : svar H0 : well_formed_closed_ex_aux
phi1^[svar:n↦patt_free_svar X] n' = true H1 : well_formed_closed_ex_aux
phi2^[svar:n↦patt_free_svar X] n' = true
true && true = true
reflexivity .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi1^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi2^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi2 n' = truen, n' : db_index X : svar H : well_formed_closed_ex_aux
(patt_imp phi1 phi2)^{svar:n↦X} n' = true
well_formed_closed_ex_aux (patt_imp phi1 phi2) n' =
true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi1^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi2^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi2 n' = truen, n' : db_index X : svar H : well_formed_closed_ex_aux
phi1^[svar:n↦patt_free_svar X] n' &&
well_formed_closed_ex_aux
phi2^[svar:n↦patt_free_svar X] n' = true
well_formed_closed_ex_aux (patt_imp phi1 phi2) n' =
true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi1^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi2^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi2 n' = truen, n' : db_index X : svar H : well_formed_closed_ex_aux
phi1^[svar:n↦patt_free_svar X] n' &&
well_formed_closed_ex_aux
phi2^[svar:n↦patt_free_svar X] n' = true
well_formed_closed_ex_aux phi1 n' &&
well_formed_closed_ex_aux phi2 n' = true
destruct_and!. Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi1^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi2^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi2 n' = truen, n' : db_index X : svar H0 : well_formed_closed_ex_aux
phi1^[svar:n↦patt_free_svar X] n' = true H1 : well_formed_closed_ex_aux
phi2^[svar:n↦patt_free_svar X] n' = true
well_formed_closed_ex_aux phi1 n' &&
well_formed_closed_ex_aux phi2 n' = true
erewrite IHphi1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi1^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi2^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi2 n' = truen, n' : db_index X : svar H0 : well_formed_closed_ex_aux
phi1^[svar:n↦patt_free_svar X] n' = true H1 : well_formed_closed_ex_aux
phi2^[svar:n↦patt_free_svar X] n' = true
true && well_formed_closed_ex_aux phi2 n' = true
2 : eassumption .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi1^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi2^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi2 n' = truen, n' : db_index X : svar H0 : well_formed_closed_ex_aux
phi1^[svar:n↦patt_free_svar X] n' = true H1 : well_formed_closed_ex_aux
phi2^[svar:n↦patt_free_svar X] n' = true
true && well_formed_closed_ex_aux phi2 n' = true
erewrite IHphi2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi1^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi2^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi2 n' = truen, n' : db_index X : svar H0 : well_formed_closed_ex_aux
phi1^[svar:n↦patt_free_svar X] n' = true H1 : well_formed_closed_ex_aux
phi2^[svar:n↦patt_free_svar X] n' = true
true && true = true
2 : eassumption .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi1^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi1 n' = trueIHphi2 : ∀ (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi2^{svar:n↦X}
n' = true
→ well_formed_closed_ex_aux phi2 n' = truen, n' : db_index X : svar H0 : well_formed_closed_ex_aux
phi1^[svar:n↦patt_free_svar X] n' = true H1 : well_formed_closed_ex_aux
phi2^[svar:n↦patt_free_svar X] n' = true
true && true = true
reflexivity .
Qed .
Lemma wfc_mu_aux_body_mu_imp2 :
forall phi n X ,
well_formed_closed_mu_aux (phi^{svar: n ↦ X}) n = true
->
well_formed_closed_mu_aux phi (S n) = true.Σ : Signature
∀ (phi : Pattern) (n : db_index) (X : svar),
well_formed_closed_mu_aux phi^{svar:n↦X} n = true
→ well_formed_closed_mu_aux phi (S n) = true
Proof using .Σ : Signature
∀ (phi : Pattern) (n : db_index) (X : svar),
well_formed_closed_mu_aux phi^{svar:n↦X} n = true
→ well_formed_closed_mu_aux phi (S n) = true
induction phi; firstorder .Σ : Signature n, n0 : db_index X : svar H : well_formed_closed_mu_aux
(patt_bound_svar n)^{svar:n0↦X} n0 = true
well_formed_closed_mu_aux (patt_bound_svar n) (S n0) =
true
- Σ : Signature n, n0 : db_index X : svar H : well_formed_closed_mu_aux
(patt_bound_svar n)^{svar:n0↦X} n0 = true
well_formed_closed_mu_aux (patt_bound_svar n) (S n0) =
true
simpl .Σ : Signature n, n0 : db_index X : svar H : well_formed_closed_mu_aux
(patt_bound_svar n)^{svar:n0↦X} n0 = true
(if decide (n < S n0) then true else false) = true
cbn in H.Σ : Signature n, n0 : db_index X : svar H : well_formed_closed_mu_aux
match compare_nat n n0 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar X
| Nat_greater _ _ _ =>
patt_bound_svar (Nat.pred n)
end n0 = true
(if decide (n < S n0) then true else false) = true
unfold well_formed_closed_mu_aux.Σ : Signature n, n0 : db_index X : svar H : well_formed_closed_mu_aux
match compare_nat n n0 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar X
| Nat_greater _ _ _ =>
patt_bound_svar (Nat.pred n)
end n0 = true
(if decide (n < S n0) then true else false) = true
repeat case_match; simpl ; auto ; try lia .Σ : Signature n, n0 : db_index X : svar g : n > n0 H0 : compare_nat n n0 = Nat_greater n n0 g H : well_formed_closed_mu_aux
(patt_bound_svar (Nat.pred n)) n0 = true n1 : ¬ n < S n0 H1 : decide (n < S n0) = right n1
false = true
unfold well_formed_closed_mu_aux in H.Σ : Signature n, n0 : db_index X : svar g : n > n0 H0 : compare_nat n n0 = Nat_greater n n0 g H : (if decide (Nat.pred n < n0) then true else false) =
true n1 : ¬ n < S n0 H1 : decide (n < S n0) = right n1
false = true
case_match; auto . Σ : Signature n, n0 : db_index X : svar g : n > n0 H0 : compare_nat n n0 = Nat_greater n n0 g l : Nat.pred n < n0 H2 : decide (Nat.pred n < n0) = left l H : true = true n1 : ¬ n < S n0 H1 : decide (n < S n0) = right n1
false = true
lia .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H : well_formed_closed_mu_aux
(patt_app phi1 phi2)^{svar:n↦X} n = true
well_formed_closed_mu_aux (patt_app phi1 phi2) (S n) =
true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H : well_formed_closed_mu_aux
phi1^[svar:n↦patt_free_svar X] n &&
well_formed_closed_mu_aux
phi2^[svar:n↦patt_free_svar X] n = true
well_formed_closed_mu_aux (patt_app phi1 phi2) (S n) =
true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H : well_formed_closed_mu_aux
phi1^[svar:n↦patt_free_svar X] n &&
well_formed_closed_mu_aux
phi2^[svar:n↦patt_free_svar X] n = true
well_formed_closed_mu_aux phi1 (S n) &&
well_formed_closed_mu_aux phi2 (S n) = true
apply andb_true_iff in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H : well_formed_closed_mu_aux
phi1^[svar:n↦patt_free_svar X] n = true
∧ well_formed_closed_mu_aux
phi2^[svar:n↦patt_free_svar X] n = true
well_formed_closed_mu_aux phi1 (S n) &&
well_formed_closed_mu_aux phi2 (S n) = true
destruct H as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H1 : well_formed_closed_mu_aux
phi1^[svar:n↦patt_free_svar X] n = true H2 : well_formed_closed_mu_aux
phi2^[svar:n↦patt_free_svar X] n = true
well_formed_closed_mu_aux phi1 (S n) &&
well_formed_closed_mu_aux phi2 (S n) = true
erewrite IHphi1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H1 : well_formed_closed_mu_aux
phi1^[svar:n↦patt_free_svar X] n = true H2 : well_formed_closed_mu_aux
phi2^[svar:n↦patt_free_svar X] n = true
true && well_formed_closed_mu_aux phi2 (S n) = true
2 : apply H1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H1 : well_formed_closed_mu_aux
phi1^[svar:n↦patt_free_svar X] n = true H2 : well_formed_closed_mu_aux
phi2^[svar:n↦patt_free_svar X] n = true
true && well_formed_closed_mu_aux phi2 (S n) = true
erewrite IHphi2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H1 : well_formed_closed_mu_aux
phi1^[svar:n↦patt_free_svar X] n = true H2 : well_formed_closed_mu_aux
phi2^[svar:n↦patt_free_svar X] n = true
true && true = true
2 : apply H2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H1 : well_formed_closed_mu_aux
phi1^[svar:n↦patt_free_svar X] n = true H2 : well_formed_closed_mu_aux
phi2^[svar:n↦patt_free_svar X] n = true
true && true = true
reflexivity .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H : well_formed_closed_mu_aux
(patt_imp phi1 phi2)^{svar:n↦X} n = true
well_formed_closed_mu_aux (patt_imp phi1 phi2) (S n) =
true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H : well_formed_closed_mu_aux
phi1^[svar:n↦patt_free_svar X] n &&
well_formed_closed_mu_aux
phi2^[svar:n↦patt_free_svar X] n = true
well_formed_closed_mu_aux (patt_imp phi1 phi2) (S n) =
true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H : well_formed_closed_mu_aux
phi1^[svar:n↦patt_free_svar X] n &&
well_formed_closed_mu_aux
phi2^[svar:n↦patt_free_svar X] n = true
well_formed_closed_mu_aux phi1 (S n) &&
well_formed_closed_mu_aux phi2 (S n) = true
apply andb_true_iff in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H : well_formed_closed_mu_aux
phi1^[svar:n↦patt_free_svar X] n = true
∧ well_formed_closed_mu_aux
phi2^[svar:n↦patt_free_svar X] n = true
well_formed_closed_mu_aux phi1 (S n) &&
well_formed_closed_mu_aux phi2 (S n) = true
destruct H as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H1 : well_formed_closed_mu_aux
phi1^[svar:n↦patt_free_svar X] n = true H2 : well_formed_closed_mu_aux
phi2^[svar:n↦patt_free_svar X] n = true
well_formed_closed_mu_aux phi1 (S n) &&
well_formed_closed_mu_aux phi2 (S n) = true
erewrite IHphi1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H1 : well_formed_closed_mu_aux
phi1^[svar:n↦patt_free_svar X] n = true H2 : well_formed_closed_mu_aux
phi2^[svar:n↦patt_free_svar X] n = true
true && well_formed_closed_mu_aux phi2 (S n) = true
2 : apply H1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H1 : well_formed_closed_mu_aux
phi1^[svar:n↦patt_free_svar X] n = true H2 : well_formed_closed_mu_aux
phi2^[svar:n↦patt_free_svar X] n = true
true && well_formed_closed_mu_aux phi2 (S n) = true
erewrite IHphi2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H1 : well_formed_closed_mu_aux
phi1^[svar:n↦patt_free_svar X] n = true H2 : well_formed_closed_mu_aux
phi2^[svar:n↦patt_free_svar X] n = true
true && true = true
2 : apply H2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi1^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi1 (S n) =
trueIHphi2 : ∀ (n : db_index) (X : svar),
well_formed_closed_mu_aux phi2^{svar:n↦X} n =
true
→ well_formed_closed_mu_aux phi2 (S n) =
truen : db_index X : svar H1 : well_formed_closed_mu_aux
phi1^[svar:n↦patt_free_svar X] n = true H2 : well_formed_closed_mu_aux
phi2^[svar:n↦patt_free_svar X] n = true
true && true = true
reflexivity .
Qed .
Lemma wfc_ex_aux_bevar_subst :
forall phi psi n ,
well_formed_closed_ex_aux phi (S n) = true
-> well_formed_closed_ex_aux psi n = true
-> well_formed_closed_ex_aux (phi^[evar : n ↦ psi]) n = true.Σ : Signature
∀ (phi psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux phi^[evar :n↦psi] n =
true
Proof .Σ : Signature
∀ (phi psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux phi^[evar :n↦psi] n =
true
intros phi psi n H H0.Σ : Signature phi, psi : Pattern n : nat H : well_formed_closed_ex_aux phi (S n) = true H0 : well_formed_closed_ex_aux psi n = true
well_formed_closed_ex_aux phi^[evar :n↦psi] n = true
generalize dependent n.Σ : Signature phi, psi : Pattern
∀ n : nat,
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux phi^[evar :n↦psi] n =
true
generalize dependent psi.Σ : Signature phi : Pattern
∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux phi^[evar :n↦psi] n =
true
induction phi; intros psi n' H H0; try lia ; auto .Σ : Signature n : db_index psi : Pattern n' : nat H : well_formed_closed_ex_aux (patt_bound_evar n)
(S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux
(patt_bound_evar n)^[evar :n'↦psi] n' = true
- Σ : Signature n : db_index psi : Pattern n' : nat H : well_formed_closed_ex_aux (patt_bound_evar n)
(S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux
(patt_bound_evar n)^[evar :n'↦psi] n' = true
simpl in *.Σ : Signature n : db_index psi : Pattern n' : nat H : (if decide (n < S n') then true else false) = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end n' = true
unfold well_formed_closed_ex_aux.Σ : Signature n : db_index psi : Pattern n' : nat H : (if decide (n < S n') then true else false) = true H0 : well_formed_closed_ex_aux psi n' = true
(fix well_formed_closed_ex_aux
(phi : Pattern) (max_ind_evar : db_index) {struct
phi} : bool :=
match phi with
| patt_bound_evar n =>
if decide (n < max_ind_evar)
then true
else false
| patt_app psi1 psi2 | patt_imp psi1 psi2 =>
well_formed_closed_ex_aux psi1 max_ind_evar &&
well_formed_closed_ex_aux psi2 max_ind_evar
| patt_exists psi =>
well_formed_closed_ex_aux psi (S max_ind_evar)
| patt_mu psi =>
well_formed_closed_ex_aux psi max_ind_evar
| _ => true
end )
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end n' = true
repeat case_match; simpl ; auto .Σ : Signature n : db_index psi : Pattern n' : nat l : n < S n' H1 : decide (n < S n') = left l H : true = true H0 : well_formed_closed_ex_aux psi n' = true g : n > n' H2 : compare_nat n n' = Nat_greater n n' g n0 : ¬ Nat.pred n < n' H3 : decide (Nat.pred n < n') = right n0
false = true
lia .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux
(patt_app phi1 phi2) (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux
(patt_app phi1 phi2)^[evar :n'↦psi] n' = true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux
(patt_app phi1 phi2) (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi1^[evar :n'↦psi] n' &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n' = true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux phi1 (S n') &&
well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi1^[evar :n'↦psi] n' &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n' = true
apply andb_true_iff in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux phi1 (S n') = true
∧ well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi1^[evar :n'↦psi] n' &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n' = true
destruct H as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H1 : well_formed_closed_ex_aux phi1 (S n') = true H2 : well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi1^[evar :n'↦psi] n' &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n' = true
rewrite IHphi1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H1 : well_formed_closed_ex_aux phi1 (S n') = true H2 : well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi1 (S n') = true
apply H1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H1 : well_formed_closed_ex_aux phi1 (S n') = true H2 : well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux psi n' = true
assumption .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H1 : well_formed_closed_ex_aux phi1 (S n') = true H2 : well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
true &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n' = true
rewrite IHphi2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H1 : well_formed_closed_ex_aux phi1 (S n') = true H2 : well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi2 (S n') = true
apply H2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H1 : well_formed_closed_ex_aux phi1 (S n') = true H2 : well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux psi n' = true
assumption .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H1 : well_formed_closed_ex_aux phi1 (S n') = true H2 : well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
true && true = true
reflexivity .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux
(patt_imp phi1 phi2) (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux
(patt_imp phi1 phi2)^[evar :n'↦psi] n' = true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux
(patt_imp phi1 phi2) (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi1^[evar :n'↦psi] n' &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n' = true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux phi1 (S n') &&
well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi1^[evar :n'↦psi] n' &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n' = true
apply andb_true_iff in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux phi1 (S n') = true
∧ well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi1^[evar :n'↦psi] n' &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n' = true
destruct H as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H1 : well_formed_closed_ex_aux phi1 (S n') = true H2 : well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi1^[evar :n'↦psi] n' &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n' = true
rewrite IHphi1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H1 : well_formed_closed_ex_aux phi1 (S n') = true H2 : well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi1 (S n') = true
apply H1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H1 : well_formed_closed_ex_aux phi1 (S n') = true H2 : well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux psi n' = true
assumption .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H1 : well_formed_closed_ex_aux phi1 (S n') = true H2 : well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
true &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n' = true
rewrite IHphi2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H1 : well_formed_closed_ex_aux phi1 (S n') = true H2 : well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi2 (S n') = true
apply H2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H1 : well_formed_closed_ex_aux phi1 (S n') = true H2 : well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux psi n' = true
assumption .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi1 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi2 (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n↦psi] n = truepsi : Pattern n' : nat H1 : well_formed_closed_ex_aux phi1 (S n') = true H2 : well_formed_closed_ex_aux phi2 (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
true && true = true
reflexivity .
- Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux (patt_exists phi) (S n') =
true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux
(patt_exists phi)^[evar :n'↦psi] n' = true
simpl .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux (patt_exists phi) (S n') =
true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi^[evar :S n'↦psi] (S n') =
true
simpl in H.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux phi (S (S n')) = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi^[evar :S n'↦psi] (S n') =
true
rewrite IHphi.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux phi (S (S n')) = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi (S (S n')) = true
assumption .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux phi (S (S n')) = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux psi (S n') = true
2 : reflexivity .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux phi (S (S n')) = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux psi (S n') = true
eapply well_formed_closed_ex_aux_ind.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux phi (S (S n')) = true H0 : well_formed_closed_ex_aux psi n' = true
?ind_evar1 ≤ S n'
2 : apply H0.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux phi (S (S n')) = true H0 : well_formed_closed_ex_aux psi n' = true
n' ≤ S n'
lia .
- Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux (patt_mu phi) (S n') =
true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux (patt_mu phi)^[evar :n'↦psi]
n' = true
simpl .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux (patt_mu phi) (S n') =
true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi^[evar :n'↦psi] n' = true
simpl in H.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux phi (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi^[evar :n'↦psi] n' = true
rewrite IHphi.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux phi (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux phi (S n') = true
apply H.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux phi (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
well_formed_closed_ex_aux psi n' = true
eapply well_formed_closed_ex_aux_ind.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux phi (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
?ind_evar1 ≤ n'
2 : apply H0.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux phi (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
n' ≤ n'
lia .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n : nat),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n↦psi] n = truepsi : Pattern n' : nat H : well_formed_closed_ex_aux phi (S n') = true H0 : well_formed_closed_ex_aux psi n' = true
true = true
reflexivity .
Qed .
Lemma wfc_mu_aux_bevar_subst :
forall phi psi n n' ,
well_formed_closed_mu_aux phi n' = true
-> well_formed_closed_mu_aux psi n' = true
-> well_formed_closed_mu_aux (phi^[evar : n ↦ psi]) n' = true.Σ : Signature
∀ (phi psi : Pattern) (n n' : db_index),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux phi^[evar :n↦psi] n' =
true
Proof .Σ : Signature
∀ (phi psi : Pattern) (n n' : db_index),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux phi^[evar :n↦psi] n' =
true
intros phi psi n n' H H0.Σ : Signature phi, psi : Pattern n, n' : db_index H : well_formed_closed_mu_aux phi n' = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi^[evar :n↦psi] n' = true
generalize dependent n.Σ : Signature phi, psi : Pattern n' : db_index H : well_formed_closed_mu_aux phi n' = true H0 : well_formed_closed_mu_aux psi n' = true
∀ n : db_index,
well_formed_closed_mu_aux phi^[evar :n↦psi] n' = true
generalize dependent n'.Σ : Signature phi, psi : Pattern
∀ n' : db_index,
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux phi^[evar :n↦psi] n' =
true
generalize dependent psi.Σ : Signature phi : Pattern
∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux phi^[evar :n↦psi] n' =
true
induction phi; intros psi n' H n'' H0; try lia ; auto .Σ : Signature n : db_index psi : Pattern n' : db_index H : well_formed_closed_mu_aux (patt_bound_evar n) n' =
true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux
(patt_bound_evar n)^[evar :H0↦psi] n' = true
- Σ : Signature n : db_index psi : Pattern n' : db_index H : well_formed_closed_mu_aux (patt_bound_evar n) n' =
true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux
(patt_bound_evar n)^[evar :H0↦psi] n' = true
simpl in *.Σ : Signature n : db_index psi : Pattern n' : db_index H : true = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux
match compare_nat n H0 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end n' = true
unfold well_formed_closed_mu_aux.Σ : Signature n : db_index psi : Pattern n' : db_index H : true = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
(fix well_formed_closed_mu_aux
(phi : Pattern) (max_ind_svar : db_index) {struct
phi} : bool :=
match phi with
| patt_bound_svar n =>
if decide (n < max_ind_svar)
then true
else false
| patt_app psi1 psi2 | patt_imp psi1 psi2 =>
well_formed_closed_mu_aux psi1 max_ind_svar &&
well_formed_closed_mu_aux psi2 max_ind_svar
| patt_exists psi =>
well_formed_closed_mu_aux psi max_ind_svar
| patt_mu psi =>
well_formed_closed_mu_aux psi (S max_ind_svar)
| _ => true
end )
match compare_nat n H0 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end n' = true
repeat case_match; simpl ; auto .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi1 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi1^[evar :n↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi2 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi2^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux (patt_app phi1 phi2) n' =
true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux
(patt_app phi1 phi2)^[evar :H0↦psi] n' = true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi1 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi1^[evar :n↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi2 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi2^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux (patt_app phi1 phi2) n' =
true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux phi1^[evar :H0↦psi] n' &&
well_formed_closed_mu_aux phi2^[evar :H0↦psi] n' = true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi1 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi1^[evar :n↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi2 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi2^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux phi1 n' &&
well_formed_closed_mu_aux phi2 n' = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux phi1^[evar :H0↦psi] n' &&
well_formed_closed_mu_aux phi2^[evar :H0↦psi] n' = true
rewrite IHphi1; auto with nocore.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi1 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi1^[evar :n↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi2 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi2^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux phi1 n' &&
well_formed_closed_mu_aux phi2 n' = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux phi1 n' = true
2 : rewrite IHphi2; auto .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi1 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi1^[evar :n↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi2 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi2^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux phi1 n' &&
well_formed_closed_mu_aux phi2 n' = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux phi1 n' = true
all : destruct_and!; auto .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi1 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi1^[evar :n↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi2 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi2^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux (patt_imp phi1 phi2) n' =
true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux
(patt_imp phi1 phi2)^[evar :H0↦psi] n' = true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi1 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi1^[evar :n↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi2 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi2^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux (patt_imp phi1 phi2) n' =
true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux phi1^[evar :H0↦psi] n' &&
well_formed_closed_mu_aux phi2^[evar :H0↦psi] n' = true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi1 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi1^[evar :n↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi2 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi2^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux phi1 n' &&
well_formed_closed_mu_aux phi2 n' = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux phi1^[evar :H0↦psi] n' &&
well_formed_closed_mu_aux phi2^[evar :H0↦psi] n' = true
destruct_and!. Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi1 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi1^[evar :n↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi2 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi2^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H1 : well_formed_closed_mu_aux phi1 n' = true H2 : well_formed_closed_mu_aux phi2 n' = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux phi1^[evar :H0↦psi] n' &&
well_formed_closed_mu_aux phi2^[evar :H0↦psi] n' = true
rewrite IHphi1; auto with nocore.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi1 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi1^[evar :n↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi2 n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi2^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H1 : well_formed_closed_mu_aux phi1 n' = true H2 : well_formed_closed_mu_aux phi2 n' = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
true &&
well_formed_closed_mu_aux phi2^[evar :H0↦psi] n' = true
rewrite IHphi2; auto .
- Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux (patt_exists phi) n' =
true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux
(patt_exists phi)^[evar :H0↦psi] n' = true
simpl .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux (patt_exists phi) n' =
true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux phi^[evar :S H0↦psi] n' =
true
simpl in H.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux phi n' = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux phi^[evar :S H0↦psi] n' =
true
rewrite IHphi.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux phi n' = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux phi n' = true
assumption .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux phi n' = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux psi n' = true
2 : reflexivity .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux phi n' = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux psi n' = true
eauto using well_formed_closed_ex_aux_ind.
- Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux (patt_mu phi) n' = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux (patt_mu phi)^[evar :H0↦psi]
n' = true
simpl .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux (patt_mu phi) n' = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux phi^[evar :H0↦psi] (S n') =
true
simpl in H.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux phi (S n') = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux phi^[evar :H0↦psi] (S n') =
true
rewrite IHphi.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux phi (S n') = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux phi (S n') = true
apply H.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux phi (S n') = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux psi (S n') = true
2 : reflexivity .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux phi (S n') = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
well_formed_closed_mu_aux psi (S n') = true
eapply well_formed_closed_mu_aux_ind.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux phi (S n') = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
?ind_svar1 ≤ S n'
2 : eassumption .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : db_index),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux psi n' = true
→ ∀ n : db_index,
well_formed_closed_mu_aux
phi^[evar :n↦psi] n' = truepsi : Pattern n' : db_index H : well_formed_closed_mu_aux phi (S n') = true n'' : well_formed_closed_mu_aux psi n' = true H0 : db_index
n' ≤ S n'
lia .
Qed .
Lemma wfc_ex_aux_bsvar_subst :
forall phi psi n n' ,
well_formed_closed_ex_aux phi n = true
-> well_formed_closed_ex_aux psi n = true
-> well_formed_closed_ex_aux (phi^[svar: n' ↦ psi]) n = true.Σ : Signature
∀ (phi psi : Pattern) (n n' : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux phi^[svar:n'↦psi] n =
true
Proof .Σ : Signature
∀ (phi psi : Pattern) (n n' : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux phi^[svar:n'↦psi] n =
true
intros phi psi n n' H H0.Σ : Signature phi, psi : Pattern n, n' : db_index H : well_formed_closed_ex_aux phi n = true H0 : well_formed_closed_ex_aux psi n = true
well_formed_closed_ex_aux phi^[svar:n'↦psi] n = true
generalize dependent n.Σ : Signature phi, psi : Pattern n' : db_index
∀ n : db_index,
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux phi^[svar:n'↦psi] n =
true
generalize dependent n'.Σ : Signature phi, psi : Pattern
∀ n' n : db_index,
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux phi^[svar:n'↦psi] n =
true
generalize dependent psi.Σ : Signature phi : Pattern
∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux phi^[svar:n'↦psi] n =
true
induction phi; intros psi n' n'' H H0; try lia ; auto .Σ : Signature n : db_index psi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux (patt_bound_svar n) n'' =
true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux
(patt_bound_svar n)^[svar:n'↦psi] n'' = true
- Σ : Signature n : db_index psi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux (patt_bound_svar n) n'' =
true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux
(patt_bound_svar n)^[svar:n'↦psi] n'' = true
simpl in *.Σ : Signature n : db_index psi : Pattern n', n'' : db_index H : true = true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end n'' = true
unfold well_formed_closed_ex_aux.Σ : Signature n : db_index psi : Pattern n', n'' : db_index H : true = true H0 : well_formed_closed_ex_aux psi n'' = true
(fix well_formed_closed_ex_aux
(phi : Pattern) (max_ind_evar : db_index) {struct
phi} : bool :=
match phi with
| patt_bound_evar n =>
if decide (n < max_ind_evar)
then true
else false
| patt_app psi1 psi2 | patt_imp psi1 psi2 =>
well_formed_closed_ex_aux psi1 max_ind_evar &&
well_formed_closed_ex_aux psi2 max_ind_evar
| patt_exists psi =>
well_formed_closed_ex_aux psi (S max_ind_evar)
| patt_mu psi =>
well_formed_closed_ex_aux psi max_ind_evar
| _ => true
end )
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end n'' = true
repeat case_match; simpl ; auto .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi1 n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi2 n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux (patt_app phi1 phi2) n'' =
true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux
(patt_app phi1 phi2)^[svar:n'↦psi] n'' = true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi1 n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi2 n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux (patt_app phi1 phi2) n'' =
true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux phi1^[svar:n'↦psi] n'' &&
well_formed_closed_ex_aux phi2^[svar:n'↦psi] n'' =
true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi1 n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi2 n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux phi1 n'' &&
well_formed_closed_ex_aux phi2 n'' = true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux phi1^[svar:n'↦psi] n'' &&
well_formed_closed_ex_aux phi2^[svar:n'↦psi] n'' =
true
destruct_and!. Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi1 n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi2 n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H1 : well_formed_closed_ex_aux phi1 n'' = true H2 : well_formed_closed_ex_aux phi2 n'' = true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux phi1^[svar:n'↦psi] n'' &&
well_formed_closed_ex_aux phi2^[svar:n'↦psi] n'' =
true
split_and; auto .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi1 n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi2 n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux (patt_imp phi1 phi2) n'' =
true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux
(patt_imp phi1 phi2)^[svar:n'↦psi] n'' = true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi1 n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi2 n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux (patt_imp phi1 phi2) n'' =
true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux phi1^[svar:n'↦psi] n'' &&
well_formed_closed_ex_aux phi2^[svar:n'↦psi] n'' =
true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi1 n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi2 n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux phi1 n'' &&
well_formed_closed_ex_aux phi2 n'' = true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux phi1^[svar:n'↦psi] n'' &&
well_formed_closed_ex_aux phi2^[svar:n'↦psi] n'' =
true
destruct_and!. Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi1 n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi2 n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H1 : well_formed_closed_ex_aux phi1 n'' = true H2 : well_formed_closed_ex_aux phi2 n'' = true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux phi1^[svar:n'↦psi] n'' &&
well_formed_closed_ex_aux phi2^[svar:n'↦psi] n'' =
true
split_and; auto .
- Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux (patt_exists phi) n'' =
true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux
(patt_exists phi)^[svar:n'↦psi] n'' = true
simpl .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux (patt_exists phi) n'' =
true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux phi^[svar:n'↦psi] (S n'') =
true
simpl in H.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux phi (S n'') = true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux phi^[svar:n'↦psi] (S n'') =
true
rewrite IHphi.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux phi (S n'') = true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux phi (S n'') = true
assumption .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux phi (S n'') = true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux psi (S n'') = true
eapply well_formed_closed_ex_aux_ind.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux phi (S n'') = true H0 : well_formed_closed_ex_aux psi n'' = true
?ind_evar1 ≤ S n''
2 : eassumption .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux phi (S n'') = true H0 : well_formed_closed_ex_aux psi n'' = true
n'' ≤ S n''
lia .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux phi (S n'') = true H0 : well_formed_closed_ex_aux psi n'' = true
true = true
reflexivity .
- Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux (patt_mu phi) n'' = true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux (patt_mu phi)^[svar:n'↦psi]
n'' = true
simpl .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux (patt_mu phi) n'' = true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux phi^[svar:S n'↦psi] n'' =
true
simpl in H.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux phi n'' = true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux phi^[svar:S n'↦psi] n'' =
true
rewrite IHphi.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux phi n'' = true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux phi n'' = true
apply H.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux phi n'' = true H0 : well_formed_closed_ex_aux psi n'' = true
well_formed_closed_ex_aux psi n'' = true
eapply well_formed_closed_ex_aux_ind.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux phi n'' = true H0 : well_formed_closed_ex_aux psi n'' = true
?ind_evar1 ≤ n''
2 : eassumption .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux phi n'' = true H0 : well_formed_closed_ex_aux psi n'' = true
n'' ≤ n''
lia .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' n : db_index),
well_formed_closed_ex_aux phi n = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n', n'' : db_index H : well_formed_closed_ex_aux phi n'' = true H0 : well_formed_closed_ex_aux psi n'' = true
true = true
reflexivity .
Qed .
Lemma wfc_mu_aux_bsvar_subst :
forall phi psi n' ,
well_formed_closed_mu_aux phi (S n') = true
-> well_formed_closed_mu_aux psi n' = true
-> well_formed_closed_mu_aux (phi^[svar: n' ↦ psi]) n' = true.Σ : Signature
∀ (phi psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux phi^[svar:n'↦psi] n' =
true
Proof .Σ : Signature
∀ (phi psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux phi^[svar:n'↦psi] n' =
true
intros phi psi n' H H0.Σ : Signature phi, psi : Pattern n' : nat H : well_formed_closed_mu_aux phi (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi^[svar:n'↦psi] n' = true
generalize dependent n'.Σ : Signature phi, psi : Pattern
∀ n' : nat,
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux phi^[svar:n'↦psi] n' =
true
generalize dependent psi.Σ : Signature phi : Pattern
∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux phi^[svar:n'↦psi] n' =
true
induction phi; intros psi n' H H0; try lia ; auto .Σ : Signature n : db_index psi : Pattern n' : nat H : well_formed_closed_mu_aux (patt_bound_svar n)
(S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux
(patt_bound_svar n)^[svar:n'↦psi] n' = true
- Σ : Signature n : db_index psi : Pattern n' : nat H : well_formed_closed_mu_aux (patt_bound_svar n)
(S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux
(patt_bound_svar n)^[svar:n'↦psi] n' = true
simpl in *.Σ : Signature n : db_index psi : Pattern n' : nat H : (if decide (n < S n') then true else false) = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end n' = true
unfold well_formed_closed_mu_aux.Σ : Signature n : db_index psi : Pattern n' : nat H : (if decide (n < S n') then true else false) = true H0 : well_formed_closed_mu_aux psi n' = true
(fix well_formed_closed_mu_aux
(phi : Pattern) (max_ind_svar : db_index) {struct
phi} : bool :=
match phi with
| patt_bound_svar n =>
if decide (n < max_ind_svar)
then true
else false
| patt_app psi1 psi2 | patt_imp psi1 psi2 =>
well_formed_closed_mu_aux psi1 max_ind_svar &&
well_formed_closed_mu_aux psi2 max_ind_svar
| patt_exists psi =>
well_formed_closed_mu_aux psi max_ind_svar
| patt_mu psi =>
well_formed_closed_mu_aux psi (S max_ind_svar)
| _ => true
end )
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end n' = true
repeat case_match; simpl ; auto .Σ : Signature n : db_index psi : Pattern n' : nat l : n < S n' H1 : decide (n < S n') = left l H : true = true H0 : well_formed_closed_mu_aux psi n' = true g : n > n' H2 : compare_nat n n' = Nat_greater n n' g n0 : ¬ Nat.pred n < n' H3 : decide (Nat.pred n < n') = right n0
false = true
lia .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux
(patt_app phi1 phi2) (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux
(patt_app phi1 phi2)^[svar:n'↦psi] n' = true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux
(patt_app phi1 phi2) (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi1^[svar:n'↦psi] n' &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n' = true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux phi1 (S n') &&
well_formed_closed_mu_aux phi2 (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi1^[svar:n'↦psi] n' &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n' = true
destruct_and!. Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H1 : well_formed_closed_mu_aux phi1 (S n') = true H2 : well_formed_closed_mu_aux phi2 (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi1^[svar:n'↦psi] n' &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n' = true
rewrite IHphi1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H1 : well_formed_closed_mu_aux phi1 (S n') = true H2 : well_formed_closed_mu_aux phi2 (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi1 (S n') = true
apply H1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H1 : well_formed_closed_mu_aux phi1 (S n') = true H2 : well_formed_closed_mu_aux phi2 (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux psi n' = true
assumption .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H1 : well_formed_closed_mu_aux phi1 (S n') = true H2 : well_formed_closed_mu_aux phi2 (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
true &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n' = true
rewrite IHphi2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H1 : well_formed_closed_mu_aux phi1 (S n') = true H2 : well_formed_closed_mu_aux phi2 (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi2 (S n') = true
apply H2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H1 : well_formed_closed_mu_aux phi1 (S n') = true H2 : well_formed_closed_mu_aux phi2 (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux psi n' = true
assumption .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H1 : well_formed_closed_mu_aux phi1 (S n') = true H2 : well_formed_closed_mu_aux phi2 (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
true && true = true
reflexivity .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux
(patt_imp phi1 phi2) (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux
(patt_imp phi1 phi2)^[svar:n'↦psi] n' = true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux
(patt_imp phi1 phi2) (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi1^[svar:n'↦psi] n' &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n' = true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux phi1 (S n') &&
well_formed_closed_mu_aux phi2 (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi1^[svar:n'↦psi] n' &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n' = true
destruct_and!. Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H1 : well_formed_closed_mu_aux phi1 (S n') = true H2 : well_formed_closed_mu_aux phi2 (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi1^[svar:n'↦psi] n' &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n' = true
rewrite IHphi1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H1 : well_formed_closed_mu_aux phi1 (S n') = true H2 : well_formed_closed_mu_aux phi2 (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi1 (S n') = true
apply H1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H1 : well_formed_closed_mu_aux phi1 (S n') = true H2 : well_formed_closed_mu_aux phi2 (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux psi n' = true
assumption .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H1 : well_formed_closed_mu_aux phi1 (S n') = true H2 : well_formed_closed_mu_aux phi2 (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
true &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n' = true
rewrite IHphi2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H1 : well_formed_closed_mu_aux phi1 (S n') = true H2 : well_formed_closed_mu_aux phi2 (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi2 (S n') = true
apply H2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H1 : well_formed_closed_mu_aux phi1 (S n') = true H2 : well_formed_closed_mu_aux phi2 (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux psi n' = true
assumption .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi1 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n' = trueIHphi2 : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi2 (S n') =
true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H1 : well_formed_closed_mu_aux phi1 (S n') = true H2 : well_formed_closed_mu_aux phi2 (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
true && true = true
reflexivity .
- Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux (patt_exists phi) (S n') =
true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux
(patt_exists phi)^[svar:n'↦psi] n' = true
simpl .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux (patt_exists phi) (S n') =
true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi^[svar:n'↦psi] n' = true
simpl in H.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux phi (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi^[svar:n'↦psi] n' = true
rewrite IHphi.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux phi (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi (S n') = true
assumption .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux phi (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux psi n' = true
assumption .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux phi (S n') = true H0 : well_formed_closed_mu_aux psi n' = true
true = true
reflexivity .
- Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux (patt_mu phi) (S n') =
true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux (patt_mu phi)^[svar:n'↦psi]
n' = true
simpl .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux (patt_mu phi) (S n') =
true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi^[svar:S n'↦psi] (S n') =
true
simpl in H.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux phi (S (S n')) = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi^[svar:S n'↦psi] (S n') =
true
rewrite IHphi.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux phi (S (S n')) = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux phi (S (S n')) = true
apply H.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux phi (S (S n')) = true H0 : well_formed_closed_mu_aux psi n' = true
well_formed_closed_mu_aux psi (S n') = true
eapply well_formed_closed_mu_aux_ind.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux phi (S (S n')) = true H0 : well_formed_closed_mu_aux psi n' = true
?ind_svar1 ≤ S n'
2 : eassumption .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux phi (S (S n')) = true H0 : well_formed_closed_mu_aux psi n' = true
n' ≤ S n'
lia .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n' : nat),
well_formed_closed_mu_aux phi (S n') = true
→ well_formed_closed_mu_aux psi n' = true
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n' = truepsi : Pattern n' : nat H : well_formed_closed_mu_aux phi (S (S n')) = true H0 : well_formed_closed_mu_aux psi n' = true
true = true
reflexivity .
Qed .
(*Helper lemma for wf_ex_to_wf_body *)
Corollary wfc_ex_aux_body_ex_imp1 :
forall phi n x ,
well_formed_closed_ex_aux phi (S n) = true
->
well_formed_closed_ex_aux (phi^{evar : n ↦ x}) n = true.Σ : Signature
∀ (phi : Pattern) (n : nat) (x : evar ),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux phi^{evar :n↦x} n = true
Proof using .Σ : Signature
∀ (phi : Pattern) (n : nat) (x : evar ),
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux phi^{evar :n↦x} n = true
intros .Σ : Signature phi : Pattern n : nat x : evar H : well_formed_closed_ex_aux phi (S n) = true
well_formed_closed_ex_aux phi^{evar :n↦x} n = true
apply wfc_ex_aux_bevar_subst; auto .
Qed .
Corollary wfc_mu_aux_body_ex_imp1 :
forall phi n n' x ,
well_formed_closed_mu_aux phi n' = true
->
well_formed_closed_mu_aux (phi^{evar : n ↦ x}) n' = true.Σ : Signature
∀ (phi : Pattern) (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux phi^{evar :n↦x} n' = true
Proof using .Σ : Signature
∀ (phi : Pattern) (n n' : db_index) (x : evar ),
well_formed_closed_mu_aux phi n' = true
→ well_formed_closed_mu_aux phi^{evar :n↦x} n' = true
intros .Σ : Signature phi : Pattern n, n' : db_index x : evar H : well_formed_closed_mu_aux phi n' = true
well_formed_closed_mu_aux phi^{evar :n↦x} n' = true
now apply wfc_mu_aux_bevar_subst.
Qed .
Corollary wfc_ex_aux_body_mu_imp1 :
forall phi n n' X ,
well_formed_closed_ex_aux phi n' = true
->
well_formed_closed_ex_aux (phi^{svar: n ↦ X}) n' = true.Σ : Signature
∀ (phi : Pattern) (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi n' = true
→ well_formed_closed_ex_aux phi^{svar:n↦X} n' = true
Proof using .Σ : Signature
∀ (phi : Pattern) (n n' : db_index) (X : svar),
well_formed_closed_ex_aux phi n' = true
→ well_formed_closed_ex_aux phi^{svar:n↦X} n' = true
intros .Σ : Signature phi : Pattern n, n' : db_index X : svar H : well_formed_closed_ex_aux phi n' = true
well_formed_closed_ex_aux phi^{svar:n↦X} n' = true
now apply wfc_ex_aux_bsvar_subst.
Qed .
Corollary wfc_mu_aux_body_mu_imp1 :
forall phi n X ,
well_formed_closed_mu_aux phi (S n) = true
->
well_formed_closed_mu_aux (phi^{svar: n ↦ X}) n = true.Σ : Signature
∀ (phi : Pattern) (n : nat) (X : svar),
well_formed_closed_mu_aux phi (S n) = true
→ well_formed_closed_mu_aux phi^{svar:n↦X} n = true
Proof using .Σ : Signature
∀ (phi : Pattern) (n : nat) (X : svar),
well_formed_closed_mu_aux phi (S n) = true
→ well_formed_closed_mu_aux phi^{svar:n↦X} n = true
intros .Σ : Signature phi : Pattern n : nat X : svar H : well_formed_closed_mu_aux phi (S n) = true
well_formed_closed_mu_aux phi^{svar:n↦X} n = true
now apply wfc_mu_aux_bsvar_subst.
Qed .
Lemma wfc_mu_aux_bsvar_subst_le :
forall phi psi n n' , n' <= n ->
well_formed_closed_mu_aux phi (S n) = true ->
well_formed_closed_mu_aux psi n
->
well_formed_closed_mu_aux (phi^[svar:n' ↦ psi]) n = true.Σ : Signature
∀ (phi psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi (S n) = true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux phi^[svar:n'↦psi] n =
true
Proof using .Σ : Signature
∀ (phi psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi (S n) = true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux phi^[svar:n'↦psi] n =
true
induction phi; intros psi n0 n' H Hwf1 Hwf2; try lia ; auto .Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux
(patt_bound_svar n) (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux
(patt_bound_svar n)^[svar:n'↦psi] n0 = true
- Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux
(patt_bound_svar n) (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux
(patt_bound_svar n)^[svar:n'↦psi] n0 = true
simpl .Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux
(patt_bound_svar n) (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end n0 = true
case_match; auto . Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux
(patt_bound_svar n) (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0 l : n < n' H0 : compare_nat n n' = Nat_less n n' l
well_formed_closed_mu_aux (patt_bound_svar n) n0 =
true
simpl .Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux
(patt_bound_svar n) (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0 l : n < n' H0 : compare_nat n n' = Nat_less n n' l
(if decide (n < n0) then true else false) = true
case_match; try lia . Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux
(patt_bound_svar n) (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0 g : n > n' H0 : compare_nat n n' = Nat_greater n n' g
well_formed_closed_mu_aux
(patt_bound_svar (Nat.pred n)) n0 = true
simpl in Hwf1.Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : (if decide (n < S n0) then true else false) =
true Hwf2 : well_formed_closed_mu_aux psi n0 g : n > n' H0 : compare_nat n n' = Nat_greater n n' g
well_formed_closed_mu_aux
(patt_bound_svar (Nat.pred n)) n0 = true
case_match; try lia . Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 l : n < S n0 H1 : decide (n < S n0) = left l Hwf1 : true = true Hwf2 : well_formed_closed_mu_aux psi n0 g : n > n' H0 : compare_nat n n' = Nat_greater n n' g
well_formed_closed_mu_aux
(patt_bound_svar (Nat.pred n)) n0 = true
simpl .Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 l : n < S n0 H1 : decide (n < S n0) = left l Hwf1 : true = true Hwf2 : well_formed_closed_mu_aux psi n0 g : n > n' H0 : compare_nat n n' = Nat_greater n n' g
(if decide (Nat.pred n < n0) then true else false) =
true
case_match; lia .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi1 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi2 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux
(patt_app phi1 phi2) (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux
(patt_app phi1 phi2)^[svar:n'↦psi] n0 = true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi1 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi2 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux
(patt_app phi1 phi2) (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux phi1^[svar:n'↦psi] n0 &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n0 = true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi1 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi2 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux
(patt_app phi1 phi2) (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux phi1^[svar:n'↦psi] n0 &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n0 = true
simpl in Hwf1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi1 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi2 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux phi1 (S n0) &&
well_formed_closed_mu_aux phi2 (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux phi1^[svar:n'↦psi] n0 &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n0 = true
apply andb_true_iff in Hwf1 as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi1 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi2 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 H1 : well_formed_closed_mu_aux phi1 (S n0) = true H2 : well_formed_closed_mu_aux phi2 (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux phi1^[svar:n'↦psi] n0 &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n0 = true
rewrite (IHphi1 _ _ n'); auto with nocore.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi1 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi2 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 H1 : well_formed_closed_mu_aux phi1 (S n0) = true H2 : well_formed_closed_mu_aux phi2 (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
true &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n0 = true
rewrite (IHphi2 _ _ n'); auto .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi1 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi2 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux
(patt_imp phi1 phi2) (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux
(patt_imp phi1 phi2)^[svar:n'↦psi] n0 = true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi1 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi2 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux
(patt_imp phi1 phi2) (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux phi1^[svar:n'↦psi] n0 &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n0 = true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi1 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi2 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux
(patt_imp phi1 phi2) (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux phi1^[svar:n'↦psi] n0 &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n0 = true
simpl in Hwf1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi1 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi2 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux phi1 (S n0) &&
well_formed_closed_mu_aux phi2 (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux phi1^[svar:n'↦psi] n0 &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n0 = true
apply andb_true_iff in Hwf1 as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi1 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi2 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 H1 : well_formed_closed_mu_aux phi1 (S n0) = true H2 : well_formed_closed_mu_aux phi2 (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux phi1^[svar:n'↦psi] n0 &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n0 = true
rewrite (IHphi1 _ _ n'); auto with nocore.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi1 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi1^[svar:n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi2 (S n) =
true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi2^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 H1 : well_formed_closed_mu_aux phi1 (S n0) = true H2 : well_formed_closed_mu_aux phi2 (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
true &&
well_formed_closed_mu_aux phi2^[svar:n'↦psi] n0 = true
rewrite (IHphi2 _ _ n'); auto .
- Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi (S n) = true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux
(patt_exists phi) (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux
(patt_exists phi)^[svar:n'↦psi] n0 = true
simpl .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi (S n) = true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux
(patt_exists phi) (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux phi^[svar:n'↦psi] n0 = true
simpl in Hwf1.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi (S n) = true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux phi (S n0) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux phi^[svar:n'↦psi] n0 = true
rewrite (IHphi _ _ n'); auto .
- Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi (S n) = true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux (patt_mu phi) (S n0) =
true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux (patt_mu phi)^[svar:n'↦psi]
n0 = true
simpl .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi (S n) = true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux (patt_mu phi) (S n0) =
true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux phi^[svar:S n'↦psi] (S n0) =
true
simpl in Hwf1.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi (S n) = true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux phi (S (S n0)) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux phi^[svar:S n'↦psi] (S n0) =
true
rewrite (IHphi _ _ (S n')); auto .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi (S n) = true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux phi (S (S n0)) = true Hwf2 : well_formed_closed_mu_aux psi n0
S n' ≤ S n0
lia .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi (S n) = true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux phi (S (S n0)) = true Hwf2 : well_formed_closed_mu_aux psi n0
well_formed_closed_mu_aux psi (S n0)
eapply well_formed_closed_mu_aux_ind.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi (S n) = true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux phi (S (S n0)) = true Hwf2 : well_formed_closed_mu_aux psi n0
?ind_svar1 ≤ S n0
2 : eassumption .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_mu_aux phi (S n) = true
→ well_formed_closed_mu_aux psi n
→ well_formed_closed_mu_aux
phi^[svar:n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_mu_aux phi (S (S n0)) = true Hwf2 : well_formed_closed_mu_aux psi n0
n0 ≤ S n0
lia .
Qed .
Lemma wfc_ex_aux_bsvar_subst_le :
forall phi psi n n' , n' <= n ->
well_formed_closed_ex_aux phi (S n) = true ->
well_formed_closed_ex_aux psi n = true
->
well_formed_closed_ex_aux (phi^[evar :n'↦psi]) n = true.Σ : Signature
∀ (phi psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux phi^[evar :n'↦psi] n =
true
Proof using .Σ : Signature
∀ (phi psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux phi^[evar :n'↦psi] n =
true
induction phi; intros psi n0 n' H Hwf1 Hwf2; try lia ; auto .Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux
(patt_bound_evar n) (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux
(patt_bound_evar n)^[evar :n'↦psi] n0 = true
- Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux
(patt_bound_evar n) (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux
(patt_bound_evar n)^[evar :n'↦psi] n0 = true
simpl .Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux
(patt_bound_evar n) (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end n0 = true
case_match; auto . Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux
(patt_bound_evar n) (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true l : n < n' H0 : compare_nat n n' = Nat_less n n' l
well_formed_closed_ex_aux (patt_bound_evar n) n0 =
true
simpl .Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux
(patt_bound_evar n) (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true l : n < n' H0 : compare_nat n n' = Nat_less n n' l
(if decide (n < n0) then true else false) = true
case_match; try lia . Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux
(patt_bound_evar n) (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true g : n > n' H0 : compare_nat n n' = Nat_greater n n' g
well_formed_closed_ex_aux
(patt_bound_evar (Nat.pred n)) n0 = true
simpl in Hwf1.Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : (if decide (n < S n0) then true else false) =
true Hwf2 : well_formed_closed_ex_aux psi n0 = true g : n > n' H0 : compare_nat n n' = Nat_greater n n' g
well_formed_closed_ex_aux
(patt_bound_evar (Nat.pred n)) n0 = true
case_match; try lia . Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 l : n < S n0 H1 : decide (n < S n0) = left l Hwf1 : true = true Hwf2 : well_formed_closed_ex_aux psi n0 = true g : n > n' H0 : compare_nat n n' = Nat_greater n n' g
well_formed_closed_ex_aux
(patt_bound_evar (Nat.pred n)) n0 = true
simpl .Σ : Signature n : db_index psi : Pattern n0, n' : nat H : n' ≤ n0 l : n < S n0 H1 : decide (n < S n0) = left l Hwf1 : true = true Hwf2 : well_formed_closed_ex_aux psi n0 = true g : n > n' H0 : compare_nat n n' = Nat_greater n n' g
(if decide (Nat.pred n < n0) then true else false) =
true
case_match; lia .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi1 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi2 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux
(patt_app phi1 phi2) (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux
(patt_app phi1 phi2)^[evar :n'↦psi] n0 = true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi1 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi2 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux
(patt_app phi1 phi2) (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux phi1^[evar :n'↦psi] n0 &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n0 = true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi1 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi2 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux
(patt_app phi1 phi2) (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux phi1^[evar :n'↦psi] n0 &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n0 = true
simpl in Hwf1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi1 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi2 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux phi1 (S n0) &&
well_formed_closed_ex_aux phi2 (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux phi1^[evar :n'↦psi] n0 &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n0 = true
apply andb_true_iff in Hwf1 as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi1 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi2 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 H1 : well_formed_closed_ex_aux phi1 (S n0) = true H2 : well_formed_closed_ex_aux phi2 (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux phi1^[evar :n'↦psi] n0 &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n0 = true
rewrite (IHphi1 _ _ n'); auto with nocore.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi1 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi2 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 H1 : well_formed_closed_ex_aux phi1 (S n0) = true H2 : well_formed_closed_ex_aux phi2 (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
true &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n0 = true
rewrite (IHphi2 _ _ n'); auto .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi1 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi2 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux
(patt_imp phi1 phi2) (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux
(patt_imp phi1 phi2)^[evar :n'↦psi] n0 = true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi1 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi2 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux
(patt_imp phi1 phi2) (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux phi1^[evar :n'↦psi] n0 &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n0 = true
simpl in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi1 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi2 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux
(patt_imp phi1 phi2) (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux phi1^[evar :n'↦psi] n0 &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n0 = true
simpl in Hwf1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi1 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi2 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux phi1 (S n0) &&
well_formed_closed_ex_aux phi2 (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux phi1^[evar :n'↦psi] n0 &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n0 = true
apply andb_true_iff in Hwf1 as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi1 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi2 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 H1 : well_formed_closed_ex_aux phi1 (S n0) = true H2 : well_formed_closed_ex_aux phi2 (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux phi1^[evar :n'↦psi] n0 &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n0 = true
rewrite (IHphi1 _ _ n'); auto with nocore.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi1 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi1^[evar :n'↦psi] n = trueIHphi2 : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi2 (S n) =
true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi2^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 H1 : well_formed_closed_ex_aux phi1 (S n0) = true H2 : well_formed_closed_ex_aux phi2 (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
true &&
well_formed_closed_ex_aux phi2^[evar :n'↦psi] n0 = true
rewrite (IHphi2 _ _ n'); auto .
- Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux
(patt_exists phi) (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux
(patt_exists phi)^[evar :n'↦psi] n0 = true
simpl .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux
(patt_exists phi) (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux phi^[evar :S n'↦psi] (S n0) =
true
simpl in Hwf1.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux phi (S (S n0)) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux phi^[evar :S n'↦psi] (S n0) =
true
rewrite (IHphi _ _ (S n')); auto .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux phi (S (S n0)) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
S n' ≤ S n0
lia .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux phi (S (S n0)) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux psi (S n0) = true
eapply well_formed_closed_ex_aux_ind.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux phi (S (S n0)) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
?ind_evar1 ≤ S n0
2 : eassumption .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux phi (S (S n0)) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
n0 ≤ S n0
lia .
- Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux (patt_mu phi) (S n0) =
true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux (patt_mu phi)^[evar :n'↦psi]
n0 = true
simpl .Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux (patt_mu phi) (S n0) =
true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux phi^[evar :n'↦psi] n0 = true
simpl in Hwf1.Σ : Signature phi : Pattern IHphi : ∀ (psi : Pattern) (n n' : nat),
n' ≤ n
→ well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux psi n = true
→ well_formed_closed_ex_aux
phi^[evar :n'↦psi] n = truepsi : Pattern n0, n' : nat H : n' ≤ n0 Hwf1 : well_formed_closed_ex_aux phi (S n0) = true Hwf2 : well_formed_closed_ex_aux psi n0 = true
well_formed_closed_ex_aux phi^[evar :n'↦psi] n0 = true
rewrite (IHphi _ _ n'); auto .
Qed .
Corollary wfc_mu_aux_body_mu_imp3 :
forall phi n n' X , n' <= n ->
well_formed_closed_mu_aux phi (S n) = true
->
well_formed_closed_mu_aux (phi^{svar: n' ↦ X}) n = true.Σ : Signature
∀ (phi : Pattern) (n n' : nat) (X : svar),
n' ≤ n
→ well_formed_closed_mu_aux phi (S n) = true
→ well_formed_closed_mu_aux phi^{svar:n'↦X} n =
true
Proof using .Σ : Signature
∀ (phi : Pattern) (n n' : nat) (X : svar),
n' ≤ n
→ well_formed_closed_mu_aux phi (S n) = true
→ well_formed_closed_mu_aux phi^{svar:n'↦X} n =
true
intros .Σ : Signature phi : Pattern n, n' : nat X : svar H : n' ≤ n H0 : well_formed_closed_mu_aux phi (S n) = true
well_formed_closed_mu_aux phi^{svar:n'↦X} n = true
now apply wfc_mu_aux_bsvar_subst_le.
Qed .
Corollary wfc_mu_aux_body_ex_imp3 :
forall phi n n' X , n' <= n ->
well_formed_closed_ex_aux phi (S n) = true
->
well_formed_closed_ex_aux (phi^{evar : n' ↦ X}) n = true.Σ : Signature
∀ (phi : Pattern) (n n' : nat) (X : evar ),
n' ≤ n
→ well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux phi^{evar :n'↦X} n =
true
Proof using .Σ : Signature
∀ (phi : Pattern) (n n' : nat) (X : evar ),
n' ≤ n
→ well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux phi^{evar :n'↦X} n =
true
intros .Σ : Signature phi : Pattern n, n' : nat X : evar H : n' ≤ n H0 : well_formed_closed_ex_aux phi (S n) = true
well_formed_closed_ex_aux phi^{evar :n'↦X} n = true
now apply wfc_ex_aux_bsvar_subst_le.
Qed .
Corollary wfc_ex_aux_body_iff :
forall phi n x ,
well_formed_closed_ex_aux phi (S n) = true
<->
well_formed_closed_ex_aux (phi^{evar : n ↦ x}) n = true.Σ : Signature
∀ (phi : Pattern) (n : nat) (x : evar ),
well_formed_closed_ex_aux phi (S n) = true
↔ well_formed_closed_ex_aux phi^{evar :n↦x} n = true
Proof .Σ : Signature
∀ (phi : Pattern) (n : nat) (x : evar ),
well_formed_closed_ex_aux phi (S n) = true
↔ well_formed_closed_ex_aux phi^{evar :n↦x} n = true
split .Σ : Signature phi : Pattern n : nat x : evar
well_formed_closed_ex_aux phi (S n) = true
→ well_formed_closed_ex_aux phi^{evar :n↦x} n = true
apply wfc_ex_aux_body_ex_imp1.Σ : Signature phi : Pattern n : nat x : evar
well_formed_closed_ex_aux phi^{evar :n↦x} n = true
→ well_formed_closed_ex_aux phi (S n) = true
apply wfc_ex_aux_body_ex_imp2.
Qed .
Corollary wfc_mu_aux_body_iff :
forall phi n X ,
well_formed_closed_mu_aux phi (S n) = true
<->
well_formed_closed_mu_aux (phi^{svar: n ↦ X}) n = true.Σ : Signature
∀ (phi : Pattern) (n : nat) (X : svar),
well_formed_closed_mu_aux phi (S n) = true
↔ well_formed_closed_mu_aux phi^{svar:n↦X} n = true
Proof .Σ : Signature
∀ (phi : Pattern) (n : nat) (X : svar),
well_formed_closed_mu_aux phi (S n) = true
↔ well_formed_closed_mu_aux phi^{svar:n↦X} n = true
split .Σ : Signature phi : Pattern n : nat X : svar
well_formed_closed_mu_aux phi (S n) = true
→ well_formed_closed_mu_aux phi^{svar:n↦X} n = true
apply wfc_mu_aux_body_mu_imp1.Σ : Signature phi : Pattern n : nat X : svar
well_formed_closed_mu_aux phi^{svar:n↦X} n = true
→ well_formed_closed_mu_aux phi (S n) = true
apply wfc_mu_aux_body_mu_imp2.
Qed .
(*If (ex, phi) is closed, then its body is closed too*)
Corollary wfc_ex_to_wfc_body :
forall phi , well_formed_closed (patt_exists phi) = true -> wfc_body_ex phi.Σ : Signature
∀ phi : Pattern,
well_formed_closed (patt_exists phi) = true
→ wfc_body_ex phi
Proof .Σ : Signature
∀ phi : Pattern,
well_formed_closed (patt_exists phi) = true
→ wfc_body_ex phi
intros phi WFE.Σ : Signature phi : Pattern WFE : well_formed_closed (patt_exists phi) = true
wfc_body_ex phi
unfold wfc_body_ex.Σ : Signature phi : Pattern WFE : well_formed_closed (patt_exists phi) = true
∀ x : evar ,
x ∉ free_evars phi
→ well_formed_closed phi^{evar :0 ↦x} = true
intros x H.Σ : Signature phi : Pattern WFE : well_formed_closed (patt_exists phi) = true x : evar H : x ∉ free_evars phi
well_formed_closed phi^{evar :0 ↦x} = true
unfold well_formed_closed in *.Σ : Signature phi : Pattern WFE : well_formed_closed_mu_aux (patt_exists phi) 0 &&
well_formed_closed_ex_aux (patt_exists phi) 0 = true x : evar H : x ∉ free_evars phi
well_formed_closed_mu_aux phi^{evar :0 ↦x} 0 &&
well_formed_closed_ex_aux phi^{evar :0 ↦x} 0 = true
simpl in WFE.Σ : Signature phi : Pattern WFE : well_formed_closed_mu_aux phi 0 && well_formed_closed_ex_aux phi 1 = true x : evar H : x ∉ free_evars phi
well_formed_closed_mu_aux phi^{evar :0 ↦x} 0 &&
well_formed_closed_ex_aux phi^{evar :0 ↦x} 0 = true
apply andb_prop in WFE.Σ : Signature phi : Pattern WFE : well_formed_closed_mu_aux phi 0 = true
∧ well_formed_closed_ex_aux phi 1 = true x : evar H : x ∉ free_evars phi
well_formed_closed_mu_aux phi^{evar :0 ↦x} 0 &&
well_formed_closed_ex_aux phi^{evar :0 ↦x} 0 = true
destruct WFE as [WFE1 WFE2].Σ : Signature phi : Pattern WFE1 : well_formed_closed_mu_aux phi 0 = true WFE2 : well_formed_closed_ex_aux phi 1 = true x : evar H : x ∉ free_evars phi
well_formed_closed_mu_aux phi^{evar :0 ↦x} 0 &&
well_formed_closed_ex_aux phi^{evar :0 ↦x} 0 = true
rewrite wfc_ex_aux_body_ex_imp1.Σ : Signature phi : Pattern WFE1 : well_formed_closed_mu_aux phi 0 = true WFE2 : well_formed_closed_ex_aux phi 1 = true x : evar H : x ∉ free_evars phi
well_formed_closed_ex_aux phi 1 = true
auto .Σ : Signature phi : Pattern WFE1 : well_formed_closed_mu_aux phi 0 = true WFE2 : well_formed_closed_ex_aux phi 1 = true x : evar H : x ∉ free_evars phi
well_formed_closed_mu_aux phi^{evar :0 ↦x} 0 && true =
true
rewrite wfc_mu_aux_body_ex_imp1.Σ : Signature phi : Pattern WFE1 : well_formed_closed_mu_aux phi 0 = true WFE2 : well_formed_closed_ex_aux phi 1 = true x : evar H : x ∉ free_evars phi
well_formed_closed_mu_aux phi 0 = true
auto .Σ : Signature phi : Pattern WFE1 : well_formed_closed_mu_aux phi 0 = true WFE2 : well_formed_closed_ex_aux phi 1 = true x : evar H : x ∉ free_evars phi
true && true = true
reflexivity .
Qed .
Lemma no_neg_occ_db_bevar_subst phi psi dbi1 dbi2 :
well_formed_closed_mu_aux psi 0 = true ->
no_negative_occurrence_db_b dbi1 phi = true ->
no_negative_occurrence_db_b dbi1 (phi^[evar : dbi2 ↦ psi]) = true
with no_pos_occ_db_bevar_subst phi psi dbi1 dbi2:
well_formed_closed_mu_aux psi 0 = true ->
no_positive_occurrence_db_b dbi1 phi = true ->
no_positive_occurrence_db_b dbi1 (phi^[evar : dbi2 ↦ psi]) = true.Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi, psi : Pattern dbi1, dbi2 : db_index
well_formed_closed_mu_aux psi 0 = true
→ no_negative_occurrence_db_b dbi1 phi = true
→ no_negative_occurrence_db_b dbi1
phi^[evar :dbi2↦psi] = true
Proof .Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi, psi : Pattern dbi1, dbi2 : db_index
well_formed_closed_mu_aux psi 0 = true
→ no_negative_occurrence_db_b dbi1 phi = true
→ no_negative_occurrence_db_b dbi1
phi^[evar :dbi2↦psi] = true
- Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi, psi : Pattern dbi1, dbi2 : db_index
well_formed_closed_mu_aux psi 0 = true
→ no_negative_occurrence_db_b dbi1 phi = true
→ no_negative_occurrence_db_b dbi1
phi^[evar :dbi2↦psi] = true
move : dbi1 dbi2.Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi, psi : Pattern
∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_negative_occurrence_db_b dbi1 phi = true
→ no_negative_occurrence_db_b dbi1
phi^[evar :dbi2↦psi] = true
induction phi; intros dbi1 dbi2 Hwfcpsi Hnonegphi; cbn in *; auto with nocore.Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truen : db_index psi : Pattern dbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true Hnonegphi : true = true
no_negative_occurrence_db_b dbi1
match compare_nat n dbi2 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = true
+ Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truen : db_index psi : Pattern dbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true Hnonegphi : true = true
no_negative_occurrence_db_b dbi1
match compare_nat n dbi2 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = true
case_match; auto . Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truen : db_index psi : Pattern dbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true Hnonegphi : true = true e : n = dbi2 H : compare_nat n dbi2 = Nat_equal n dbi2 e
no_negative_occurrence_db_b dbi1 psi = true
now apply wfc_impl_no_neg_occ.
+ Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi1, phi2, psi : Pattern IHphi1 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[evar :dbi2↦psi] = trueIHphi2 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[evar :dbi2↦psi] = truedbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true Hnonegphi : no_negative_occurrence_db_b dbi1 phi1 &&
no_negative_occurrence_db_b dbi1 phi2 =
true
no_negative_occurrence_db_b dbi1 phi1^[evar :dbi2↦psi] &&
no_negative_occurrence_db_b dbi1 phi2^[evar :dbi2↦psi] =
true
destruct_and!. Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi1, phi2, psi : Pattern IHphi1 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[evar :dbi2↦psi] = trueIHphi2 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[evar :dbi2↦psi] = truedbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true H : no_negative_occurrence_db_b dbi1 phi1 = true H0 : no_negative_occurrence_db_b dbi1 phi2 = true
no_negative_occurrence_db_b dbi1 phi1^[evar :dbi2↦psi] &&
no_negative_occurrence_db_b dbi1 phi2^[evar :dbi2↦psi] =
true
rewrite -> IHphi1, -> IHphi2; auto .
+ Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi1, phi2, psi : Pattern IHphi1 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[evar :dbi2↦psi] = trueIHphi2 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[evar :dbi2↦psi] = truedbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true Hnonegphi : (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 &&
no_negative_occurrence_db_b dbi1 phi2 =
true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1
phi1^[evar :dbi2↦psi] &&
no_negative_occurrence_db_b dbi1 phi2^[evar :dbi2↦psi] =
true
destruct_and!. Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi1, phi2, psi : Pattern IHphi1 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[evar :dbi2↦psi] = trueIHphi2 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[evar :dbi2↦psi] = truedbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 = true H0 : no_negative_occurrence_db_b dbi1 phi2 = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1
phi1^[evar :dbi2↦psi] &&
no_negative_occurrence_db_b dbi1 phi2^[evar :dbi2↦psi] =
true
fold (no_positive_occurrence_db_b dbi1 (phi1^[evar : dbi2 ↦ psi]) ).Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi1, phi2, psi : Pattern IHphi1 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[evar :dbi2↦psi] = trueIHphi2 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[evar :dbi2↦psi] = truedbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 = true H0 : no_negative_occurrence_db_b dbi1 phi2 = true
no_positive_occurrence_db_b dbi1 phi1^[evar :dbi2↦psi] &&
no_negative_occurrence_db_b dbi1 phi2^[evar :dbi2↦psi] =
true
rewrite no_pos_occ_db_bevar_subst; auto with nocore.Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi1, phi2, psi : Pattern IHphi1 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[evar :dbi2↦psi] = trueIHphi2 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[evar :dbi2↦psi] = truedbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 = true H0 : no_negative_occurrence_db_b dbi1 phi2 = true
true &&
no_negative_occurrence_db_b dbi1 phi2^[evar :dbi2↦psi] =
true
rewrite -> IHphi2; auto .
- Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi, psi : Pattern dbi1, dbi2 : db_index
well_formed_closed_mu_aux psi 0 = true
→ no_positive_occurrence_db_b dbi1 phi = true
→ no_positive_occurrence_db_b dbi1
phi^[evar :dbi2↦psi] = true
move : dbi1 dbi2.Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi, psi : Pattern
∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_positive_occurrence_db_b dbi1 phi = true
→ no_positive_occurrence_db_b dbi1
phi^[evar :dbi2↦psi] = true
induction phi; intros dbi1 dbi2 Hwfcpsi Hnonegphi; cbn in *; auto with nocore.Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truen : db_index psi : Pattern dbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true Hnonegphi : true = true
no_positive_occurrence_db_b dbi1
match compare_nat n dbi2 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = true
+ Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truen : db_index psi : Pattern dbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true Hnonegphi : true = true
no_positive_occurrence_db_b dbi1
match compare_nat n dbi2 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = true
repeat case_match; auto .Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truen : db_index psi : Pattern dbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true Hnonegphi : true = true e : n = dbi2 H : compare_nat n dbi2 = Nat_equal n dbi2 e
no_positive_occurrence_db_b dbi1 psi = true
apply wfc_impl_no_pos_occ.Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truen : db_index psi : Pattern dbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true Hnonegphi : true = true e : n = dbi2 H : compare_nat n dbi2 = Nat_equal n dbi2 e
well_formed_closed_mu_aux psi 0 = true
assumption .
+ Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi1, phi2, psi : Pattern IHphi1 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[evar :dbi2↦psi] = trueIHphi2 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[evar :dbi2↦psi] = truedbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true Hnonegphi : no_positive_occurrence_db_b dbi1 phi1 &&
no_positive_occurrence_db_b dbi1 phi2 =
true
no_positive_occurrence_db_b dbi1 phi1^[evar :dbi2↦psi] &&
no_positive_occurrence_db_b dbi1 phi2^[evar :dbi2↦psi] =
true
destruct_and!. Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi1, phi2, psi : Pattern IHphi1 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[evar :dbi2↦psi] = trueIHphi2 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[evar :dbi2↦psi] = truedbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true H : no_positive_occurrence_db_b dbi1 phi1 = true H0 : no_positive_occurrence_db_b dbi1 phi2 = true
no_positive_occurrence_db_b dbi1 phi1^[evar :dbi2↦psi] &&
no_positive_occurrence_db_b dbi1 phi2^[evar :dbi2↦psi] =
true
rewrite -> IHphi1, -> IHphi2; auto .
+ Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi1, phi2, psi : Pattern IHphi1 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[evar :dbi2↦psi] = trueIHphi2 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[evar :dbi2↦psi] = truedbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true Hnonegphi : (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 &&
no_positive_occurrence_db_b dbi1 phi2 =
true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1
phi1^[evar :dbi2↦psi] &&
no_positive_occurrence_db_b dbi1 phi2^[evar :dbi2↦psi] =
true
destruct_and!. Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi1, phi2, psi : Pattern IHphi1 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[evar :dbi2↦psi] = trueIHphi2 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[evar :dbi2↦psi] = truedbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 = true H0 : no_positive_occurrence_db_b dbi1 phi2 = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1
phi1^[evar :dbi2↦psi] &&
no_positive_occurrence_db_b dbi1 phi2^[evar :dbi2↦psi] =
true
fold (no_negative_occurrence_db_b dbi1 (phi1^[evar : dbi2 ↦ psi]) ).Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi1, phi2, psi : Pattern IHphi1 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[evar :dbi2↦psi] = trueIHphi2 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[evar :dbi2↦psi] = truedbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 = true H0 : no_positive_occurrence_db_b dbi1 phi2 = true
no_negative_occurrence_db_b dbi1 phi1^[evar :dbi2↦psi] &&
no_positive_occurrence_db_b dbi1 phi2^[evar :dbi2↦psi] =
true
rewrite no_neg_occ_db_bevar_subst; auto with nocore.Σ : Signature no_neg_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_negative_occurrence_db_b
dbi1 phi = true
→ no_negative_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
trueno_pos_occ_db_bevar_subst : ∀ (phi psi : Pattern)
(dbi1 dbi2 : db_index),
well_formed_closed_mu_aux
psi 0 = true
→ no_positive_occurrence_db_b
dbi1 phi = true
→ no_positive_occurrence_db_b
dbi1
phi^[evar :dbi2↦psi] =
truephi1, phi2, psi : Pattern IHphi1 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[evar :dbi2↦psi] = trueIHphi2 : ∀ dbi1 dbi2 : db_index,
well_formed_closed_mu_aux psi 0 = true
→ no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[evar :dbi2↦psi] = truedbi1, dbi2 : db_index Hwfcpsi : well_formed_closed_mu_aux psi 0 = true H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 = true H0 : no_positive_occurrence_db_b dbi1 phi2 = true
true &&
no_positive_occurrence_db_b dbi1 phi2^[evar :dbi2↦psi] =
true
rewrite -> IHphi2; auto .
Qed .
Lemma bevar_subst_positive_2 :
forall φ ψ n ,
well_formed_closed_mu_aux ψ 0 = true ->
well_formed_positive φ = true ->
well_formed_positive ψ = true ->
well_formed_positive (φ^[evar : n ↦ ψ]) = true.Σ : Signature
∀ (φ ψ : Pattern) (n : db_index),
well_formed_closed_mu_aux ψ 0 = true
→ well_formed_positive φ = true
→ well_formed_positive ψ = true
→ well_formed_positive φ^[evar :n↦ψ] = true
Proof .Σ : Signature
∀ (φ ψ : Pattern) (n : db_index),
well_formed_closed_mu_aux ψ 0 = true
→ well_formed_positive φ = true
→ well_formed_positive ψ = true
→ well_formed_positive φ^[evar :n↦ψ] = true
induction φ; intros ψ n' H0 H1 H2; cbn in *; auto with nocore.Σ : Signature n : db_index ψ : Pattern n' : db_index H0 : well_formed_closed_mu_aux ψ 0 = true H1 : true = true H2 : well_formed_positive ψ = true
well_formed_positive
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = true
* Σ : Signature n : db_index ψ : Pattern n' : db_index H0 : well_formed_closed_mu_aux ψ 0 = true H1 : true = true H2 : well_formed_positive ψ = true
well_formed_positive
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = true
break_match_goal; auto .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : db_index),
well_formed_closed_mu_aux ψ 0 = true
→ well_formed_positive φ1 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ1^[evar :n↦ψ] =
trueIHφ2 : ∀ (ψ : Pattern) (n : db_index),
well_formed_closed_mu_aux ψ 0 = true
→ well_formed_positive φ2 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ2^[evar :n↦ψ] =
trueψ : Pattern n' : db_index H0 : well_formed_closed_mu_aux ψ 0 = true H1 : well_formed_positive φ1 &&
well_formed_positive φ2 = true H2 : well_formed_positive ψ = true
well_formed_positive φ1^[evar :n'↦ψ] &&
well_formed_positive φ2^[evar :n'↦ψ] = true
destruct_and!. Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : db_index),
well_formed_closed_mu_aux ψ 0 = true
→ well_formed_positive φ1 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ1^[evar :n↦ψ] =
trueIHφ2 : ∀ (ψ : Pattern) (n : db_index),
well_formed_closed_mu_aux ψ 0 = true
→ well_formed_positive φ2 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ2^[evar :n↦ψ] =
trueψ : Pattern n' : db_index H0 : well_formed_closed_mu_aux ψ 0 = true H : well_formed_positive φ1 = true H3 : well_formed_positive φ2 = true H2 : well_formed_positive ψ = true
well_formed_positive φ1^[evar :n'↦ψ] &&
well_formed_positive φ2^[evar :n'↦ψ] = true
rewrite -> IHφ1, -> IHφ2; auto .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : db_index),
well_formed_closed_mu_aux ψ 0 = true
→ well_formed_positive φ1 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ1^[evar :n↦ψ] =
trueIHφ2 : ∀ (ψ : Pattern) (n : db_index),
well_formed_closed_mu_aux ψ 0 = true
→ well_formed_positive φ2 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ2^[evar :n↦ψ] =
trueψ : Pattern n' : db_index H0 : well_formed_closed_mu_aux ψ 0 = true H1 : well_formed_positive φ1 &&
well_formed_positive φ2 = true H2 : well_formed_positive ψ = true
well_formed_positive φ1^[evar :n'↦ψ] &&
well_formed_positive φ2^[evar :n'↦ψ] = true
destruct_and!. Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : db_index),
well_formed_closed_mu_aux ψ 0 = true
→ well_formed_positive φ1 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ1^[evar :n↦ψ] =
trueIHφ2 : ∀ (ψ : Pattern) (n : db_index),
well_formed_closed_mu_aux ψ 0 = true
→ well_formed_positive φ2 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ2^[evar :n↦ψ] =
trueψ : Pattern n' : db_index H0 : well_formed_closed_mu_aux ψ 0 = true H : well_formed_positive φ1 = true H3 : well_formed_positive φ2 = true H2 : well_formed_positive ψ = true
well_formed_positive φ1^[evar :n'↦ψ] &&
well_formed_positive φ2^[evar :n'↦ψ] = true
rewrite -> IHφ1, -> IHφ2; auto .
* Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n : db_index),
well_formed_closed_mu_aux ψ 0 = true
→ well_formed_positive φ = true
→ well_formed_positive ψ = true
→ well_formed_positive φ^[evar :n↦ψ] = trueψ : Pattern n' : db_index H0 : well_formed_closed_mu_aux ψ 0 = true H1 : no_negative_occurrence_db_b 0 φ &&
well_formed_positive φ = true H2 : well_formed_positive ψ = true
no_negative_occurrence_db_b 0 φ^[evar :n'↦ψ] &&
well_formed_positive φ^[evar :n'↦ψ] = true
destruct_and!. Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n : db_index),
well_formed_closed_mu_aux ψ 0 = true
→ well_formed_positive φ = true
→ well_formed_positive ψ = true
→ well_formed_positive φ^[evar :n↦ψ] = trueψ : Pattern n' : db_index H0 : well_formed_closed_mu_aux ψ 0 = true H : no_negative_occurrence_db_b 0 φ = true H3 : well_formed_positive φ = true H2 : well_formed_positive ψ = true
no_negative_occurrence_db_b 0 φ^[evar :n'↦ψ] &&
well_formed_positive φ^[evar :n'↦ψ] = true
rewrite IHφ; auto with nocore.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n : db_index),
well_formed_closed_mu_aux ψ 0 = true
→ well_formed_positive φ = true
→ well_formed_positive ψ = true
→ well_formed_positive φ^[evar :n↦ψ] = trueψ : Pattern n' : db_index H0 : well_formed_closed_mu_aux ψ 0 = true H : no_negative_occurrence_db_b 0 φ = true H3 : well_formed_positive φ = true H2 : well_formed_positive ψ = true
no_negative_occurrence_db_b 0 φ^[evar :n'↦ψ] && true =
true
rewrite andb_true_r.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n : db_index),
well_formed_closed_mu_aux ψ 0 = true
→ well_formed_positive φ = true
→ well_formed_positive ψ = true
→ well_formed_positive φ^[evar :n↦ψ] = trueψ : Pattern n' : db_index H0 : well_formed_closed_mu_aux ψ 0 = true H : no_negative_occurrence_db_b 0 φ = true H3 : well_formed_positive φ = true H2 : well_formed_positive ψ = true
no_negative_occurrence_db_b 0 φ^[evar :n'↦ψ] = true
rewrite no_neg_occ_db_bevar_subst; auto .
Qed .
Corollary wfp_evar_open : forall phi x n ,
well_formed_positive phi = true ->
well_formed_positive (phi^{evar : n ↦ x}) = true.Σ : Signature
∀ (phi : Pattern) (x : evar ) (n : db_index),
well_formed_positive phi = true
→ well_formed_positive phi^{evar :n↦x} = true
Proof .Σ : Signature
∀ (phi : Pattern) (x : evar ) (n : db_index),
well_formed_positive phi = true
→ well_formed_positive phi^{evar :n↦x} = true
intros phi x n WF.Σ : Signature phi : Pattern x : evar n : db_index WF : well_formed_positive phi = true
well_formed_positive phi^{evar :n↦x} = true
apply bevar_subst_positive_2; auto .
Qed .
(* Additional lemmas: evar_open, svar_open, freshness, well_formedness, etc. *)
(* evar_open and evar_quantify are inverses *)
Lemma evar_open_evar_quantify x n phi :
well_formed_closed_ex_aux phi n ->
((phi^{{evar : x ↦ n}})^{evar : n ↦ x}) = phi.Σ : Signature x : evar n : db_index phi : Pattern
well_formed_closed_ex_aux phi n
→ phi^{{evar :x↦n}}^{evar :n↦x} = phi
Proof .Σ : Signature x : evar n : db_index phi : Pattern
well_formed_closed_ex_aux phi n
→ phi^{{evar :x↦n}}^{evar :n↦x} = phi
intros H.Σ : Signature x : evar n : db_index phi : Pattern H : well_formed_closed_ex_aux phi n
phi^{{evar :x↦n}}^{evar :n↦x} = phi
(*apply wfc_wfc_ind in H.*)
move : n H.Σ : Signature x : evar phi : Pattern
∀ n : db_index,
well_formed_closed_ex_aux phi n
→ phi^{{evar :x↦n}}^{evar :n↦x} = phi
induction phi; intros n' H; cbn ; auto .Σ : Signature x, x0 : evar n' : db_index H : well_formed_closed_ex_aux (patt_free_evar x0) n'
(if decide (x = x0)
then patt_bound_evar n'
else patt_free_evar x0)^[evar :n'↦patt_free_evar x] =
patt_free_evar x0
- Σ : Signature x, x0 : evar n' : db_index H : well_formed_closed_ex_aux (patt_free_evar x0) n'
(if decide (x = x0)
then patt_bound_evar n'
else patt_free_evar x0)^[evar :n'↦patt_free_evar x] =
patt_free_evar x0
destruct (decide (x = x0)); subst ; simpl .Σ : Signature x0 : evar n' : db_index H : well_formed_closed_ex_aux (patt_free_evar x0) n'
match compare_nat n' n' with
| Nat_less _ _ _ => patt_bound_evar n'
| Nat_equal _ _ _ => patt_free_evar x0
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n')
end = patt_free_evar x0
+ Σ : Signature x0 : evar n' : db_index H : well_formed_closed_ex_aux (patt_free_evar x0) n'
match compare_nat n' n' with
| Nat_less _ _ _ => patt_bound_evar n'
| Nat_equal _ _ _ => patt_free_evar x0
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n')
end = patt_free_evar x0
break_match_goal; auto ; lia .
+ Σ : Signature x, x0 : evar n' : db_index H : well_formed_closed_ex_aux (patt_free_evar x0) n' n : x ≠ x0
patt_free_evar x0 = patt_free_evar x0
reflexivity .
- Σ : Signature x : evar n, n' : db_index H : well_formed_closed_ex_aux (patt_bound_evar n) n'
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = patt_bound_evar n
simpl in *.Σ : Signature x : evar n, n' : db_index H : if decide (n < n') then true else false
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = patt_bound_evar n
repeat case_match; simpl ; auto with nocore; try lia ; congruence .
- Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_ex_aux phi1 n
→ phi1^{{evar :x↦n}}^{evar :n↦x} = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_ex_aux phi2 n
→ phi2^{{evar :x↦n}}^{evar :n↦x} = phi2n' : db_index H : well_formed_closed_ex_aux (patt_app phi1 phi2) n'
patt_app phi1^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x]
phi2^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x] =
patt_app phi1 phi2
cbn in H.Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_ex_aux phi1 n
→ phi1^{{evar :x↦n}}^{evar :n↦x} = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_ex_aux phi2 n
→ phi2^{{evar :x↦n}}^{evar :n↦x} = phi2n' : db_index H : well_formed_closed_ex_aux phi1 n' &&
well_formed_closed_ex_aux phi2 n'
patt_app phi1^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x]
phi2^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x] =
patt_app phi1 phi2
simpl .Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_ex_aux phi1 n
→ phi1^{{evar :x↦n}}^{evar :n↦x} = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_ex_aux phi2 n
→ phi2^{{evar :x↦n}}^{evar :n↦x} = phi2n' : db_index H : well_formed_closed_ex_aux phi1 n' &&
well_formed_closed_ex_aux phi2 n'
patt_app phi1^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x]
phi2^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x] =
patt_app phi1 phi2
unfold evar_open, evar_quantify in IHphi1, IHphi2.Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_ex_aux phi1 n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu
(evar_quantify x level p')
end ) x n phi1)^[evar :n↦
patt_free_evar x] = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_ex_aux phi2 n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu
(evar_quantify x level p')
end ) x n phi2)^[evar :n↦
patt_free_evar x] = phi2n' : db_index H : well_formed_closed_ex_aux phi1 n' &&
well_formed_closed_ex_aux phi2 n'
patt_app phi1^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x]
phi2^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x] =
patt_app phi1 phi2
apply andb_true_iff in H.Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_ex_aux phi1 n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu
(evar_quantify x level p')
end ) x n phi1)^[evar :n↦
patt_free_evar x] = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_ex_aux phi2 n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu
(evar_quantify x level p')
end ) x n phi2)^[evar :n↦
patt_free_evar x] = phi2n' : db_index H : well_formed_closed_ex_aux phi1 n' = true
∧ well_formed_closed_ex_aux phi2 n' = true
patt_app phi1^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x]
phi2^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x] =
patt_app phi1 phi2
destruct H as [H1 H2].Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_ex_aux phi1 n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu
(evar_quantify x level p')
end ) x n phi1)^[evar :n↦
patt_free_evar x] = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_ex_aux phi2 n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu
(evar_quantify x level p')
end ) x n phi2)^[evar :n↦
patt_free_evar x] = phi2n' : db_index H1 : well_formed_closed_ex_aux phi1 n' = true H2 : well_formed_closed_ex_aux phi2 n' = true
patt_app phi1^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x]
phi2^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x] =
patt_app phi1 phi2
erewrite -> IHphi1, IHphi2 by eassumption .Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_ex_aux phi1 n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu
(evar_quantify x level p')
end ) x n phi1)^[evar :n↦
patt_free_evar x] = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_ex_aux phi2 n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu
(evar_quantify x level p')
end ) x n phi2)^[evar :n↦
patt_free_evar x] = phi2n' : db_index H1 : well_formed_closed_ex_aux phi1 n' = true H2 : well_formed_closed_ex_aux phi2 n' = true
patt_app phi1 phi2 = patt_app phi1 phi2
reflexivity .
- Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_ex_aux phi1 n
→ phi1^{{evar :x↦n}}^{evar :n↦x} = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_ex_aux phi2 n
→ phi2^{{evar :x↦n}}^{evar :n↦x} = phi2n' : db_index H : well_formed_closed_ex_aux (patt_imp phi1 phi2) n'
patt_imp phi1^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x]
phi2^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x] =
patt_imp phi1 phi2
simpl in H.Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_ex_aux phi1 n
→ phi1^{{evar :x↦n}}^{evar :n↦x} = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_ex_aux phi2 n
→ phi2^{{evar :x↦n}}^{evar :n↦x} = phi2n' : db_index H : well_formed_closed_ex_aux phi1 n' &&
well_formed_closed_ex_aux phi2 n'
patt_imp phi1^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x]
phi2^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x] =
patt_imp phi1 phi2
unfold evar_open, evar_quantify in IHphi1, IHphi2.Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_ex_aux phi1 n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu
(evar_quantify x level p')
end ) x n phi1)^[evar :n↦
patt_free_evar x] = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_ex_aux phi2 n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu
(evar_quantify x level p')
end ) x n phi2)^[evar :n↦
patt_free_evar x] = phi2n' : db_index H : well_formed_closed_ex_aux phi1 n' &&
well_formed_closed_ex_aux phi2 n'
patt_imp phi1^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x]
phi2^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x] =
patt_imp phi1 phi2
apply andb_true_iff in H.Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_ex_aux phi1 n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu
(evar_quantify x level p')
end ) x n phi1)^[evar :n↦
patt_free_evar x] = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_ex_aux phi2 n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu
(evar_quantify x level p')
end ) x n phi2)^[evar :n↦
patt_free_evar x] = phi2n' : db_index H : well_formed_closed_ex_aux phi1 n' = true
∧ well_formed_closed_ex_aux phi2 n' = true
patt_imp phi1^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x]
phi2^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x] =
patt_imp phi1 phi2
destruct H as [H1 H2].Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_ex_aux phi1 n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu
(evar_quantify x level p')
end ) x n phi1)^[evar :n↦
patt_free_evar x] = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_ex_aux phi2 n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu
(evar_quantify x level p')
end ) x n phi2)^[evar :n↦
patt_free_evar x] = phi2n' : db_index H1 : well_formed_closed_ex_aux phi1 n' = true H2 : well_formed_closed_ex_aux phi2 n' = true
patt_imp phi1^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x]
phi2^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x] =
patt_imp phi1 phi2
erewrite -> IHphi1, IHphi2 by eassumption .Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_ex_aux phi1 n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu
(evar_quantify x level p')
end ) x n phi1)^[evar :n↦
patt_free_evar x] = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_ex_aux phi2 n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu
(evar_quantify x level p')
end ) x n phi2)^[evar :n↦
patt_free_evar x] = phi2n' : db_index H1 : well_formed_closed_ex_aux phi1 n' = true H2 : well_formed_closed_ex_aux phi2 n' = true
patt_imp phi1 phi2 = patt_imp phi1 phi2
reflexivity .
- Σ : Signature x : evar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_ex_aux phi n
→ phi^{{evar :x↦n}}^{evar :n↦x} = phin' : db_index H : well_formed_closed_ex_aux (patt_exists phi) n'
patt_exists
phi^{{evar :x↦S n'}}^[evar :S n'↦patt_free_evar x] =
patt_exists phi
simpl in H.Σ : Signature x : evar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_ex_aux phi n
→ phi^{{evar :x↦n}}^{evar :n↦x} = phin' : db_index H : well_formed_closed_ex_aux phi (S n')
patt_exists
phi^{{evar :x↦S n'}}^[evar :S n'↦patt_free_evar x] =
patt_exists phi
unfold evar_open, evar_quantify in IHphi.Σ : Signature x : evar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_ex_aux phi n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu (evar_quantify x level p')
end ) x n phi)^[evar :n↦
patt_free_evar x] = phin' : db_index H : well_formed_closed_ex_aux phi (S n')
patt_exists
phi^{{evar :x↦S n'}}^[evar :S n'↦patt_free_evar x] =
patt_exists phi
erewrite -> IHphi by eassumption .Σ : Signature x : evar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_ex_aux phi n
→ ((fix evar_quantify
(x : evar ) (level : db_index)
(p : Pattern) {struct p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' =>
patt_free_svar x'
| patt_bound_evar x' =>
patt_bound_evar x'
| patt_bound_svar X =>
patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp
(evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists
(evar_quantify x (S level) p')
| patt_mu p' =>
patt_mu (evar_quantify x level p')
end ) x n phi)^[evar :n↦
patt_free_evar x] = phin' : db_index H : well_formed_closed_ex_aux phi (S n')
patt_exists phi = patt_exists phi
reflexivity .
- Σ : Signature x : evar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_ex_aux phi n
→ phi^{{evar :x↦n}}^{evar :n↦x} = phin' : db_index H : well_formed_closed_ex_aux (patt_mu phi) n'
patt_mu phi^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x] =
patt_mu phi
simpl in H.Σ : Signature x : evar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_ex_aux phi n
→ phi^{{evar :x↦n}}^{evar :n↦x} = phin' : db_index H : well_formed_closed_ex_aux phi n'
patt_mu phi^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x] =
patt_mu phi
apply IHphi in H.Σ : Signature x : evar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_ex_aux phi n
→ phi^{{evar :x↦n}}^{evar :n↦x} = phin' : db_index H : phi^{{evar :x↦n'}}^{evar :n'↦x} = phi
patt_mu phi^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x] =
patt_mu phi
unfold evar_open in H.Σ : Signature x : evar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_ex_aux phi n
→ phi^{{evar :x↦n}}^{evar :n↦x} = phin' : db_index H : phi^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x] = phi
patt_mu phi^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x] =
patt_mu phi
rewrite H.Σ : Signature x : evar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_ex_aux phi n
→ phi^{{evar :x↦n}}^{evar :n↦x} = phin' : db_index H : phi^{{evar :x↦n'}}^[evar :n'↦patt_free_evar x] = phi
patt_mu phi = patt_mu phi
reflexivity .
Qed .
Lemma svar_open_svar_quantify X n phi :
well_formed_closed_mu_aux phi n ->
((phi^{{svar: X ↦ n}})^{svar: n ↦ X}) = phi.Σ : Signature X : svar n : db_index phi : Pattern
well_formed_closed_mu_aux phi n
→ phi^{{svar:X↦n}}^{svar:n↦X} = phi
Proof .Σ : Signature X : svar n : db_index phi : Pattern
well_formed_closed_mu_aux phi n
→ phi^{{svar:X↦n}}^{svar:n↦X} = phi
intros H.Σ : Signature X : svar n : db_index phi : Pattern H : well_formed_closed_mu_aux phi n
phi^{{svar:X↦n}}^{svar:n↦X} = phi
(*apply wfc_wfc_ind in H.*)
move : n H.Σ : Signature X : svar phi : Pattern
∀ n : db_index,
well_formed_closed_mu_aux phi n
→ phi^{{svar:X↦n}}^{svar:n↦X} = phi
induction phi; intros n' H; cbn ; auto .Σ : Signature X, x : svar n' : db_index H : well_formed_closed_mu_aux (patt_free_svar x) n'
(if decide (X = x)
then patt_bound_svar n'
else patt_free_svar x)^[svar:n'↦patt_free_svar X] =
patt_free_svar x
- Σ : Signature X, x : svar n' : db_index H : well_formed_closed_mu_aux (patt_free_svar x) n'
(if decide (X = x)
then patt_bound_svar n'
else patt_free_svar x)^[svar:n'↦patt_free_svar X] =
patt_free_svar x
destruct (decide (X = x)); subst ; simpl .Σ : Signature x : svar n' : db_index H : well_formed_closed_mu_aux (patt_free_svar x) n'
match compare_nat n' n' with
| Nat_less _ _ _ => patt_bound_svar n'
| Nat_equal _ _ _ => patt_free_svar x
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n')
end = patt_free_svar x
+ Σ : Signature x : svar n' : db_index H : well_formed_closed_mu_aux (patt_free_svar x) n'
match compare_nat n' n' with
| Nat_less _ _ _ => patt_bound_svar n'
| Nat_equal _ _ _ => patt_free_svar x
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n')
end = patt_free_svar x
break_match_goal; auto ; lia .
+ Σ : Signature X, x : svar n' : db_index H : well_formed_closed_mu_aux (patt_free_svar x) n' n : X ≠ x
patt_free_svar x = patt_free_svar x
reflexivity .
- Σ : Signature X : svar n, n' : db_index H : well_formed_closed_mu_aux (patt_bound_svar n) n'
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar X
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end = patt_bound_svar n
simpl in *.Σ : Signature X : svar n, n' : db_index H : if decide (n < n') then true else false
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar X
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end = patt_bound_svar n
repeat case_match; simpl ; auto ; subst ; try lia ; try congruence .
- Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_mu_aux phi1 n
→ phi1^{{svar:X↦n}}^{svar:n↦X} = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_mu_aux phi2 n
→ phi2^{{svar:X↦n}}^{svar:n↦X} = phi2n' : db_index H : well_formed_closed_mu_aux (patt_app phi1 phi2) n'
patt_app phi1^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X]
phi2^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X] =
patt_app phi1 phi2
cbn in H.Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_mu_aux phi1 n
→ phi1^{{svar:X↦n}}^{svar:n↦X} = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_mu_aux phi2 n
→ phi2^{{svar:X↦n}}^{svar:n↦X} = phi2n' : db_index H : well_formed_closed_mu_aux phi1 n' &&
well_formed_closed_mu_aux phi2 n'
patt_app phi1^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X]
phi2^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X] =
patt_app phi1 phi2
simpl .Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_mu_aux phi1 n
→ phi1^{{svar:X↦n}}^{svar:n↦X} = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_mu_aux phi2 n
→ phi2^{{svar:X↦n}}^{svar:n↦X} = phi2n' : db_index H : well_formed_closed_mu_aux phi1 n' &&
well_formed_closed_mu_aux phi2 n'
patt_app phi1^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X]
phi2^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X] =
patt_app phi1 phi2
unfold svar_open in IHphi1, IHphi2.Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_mu_aux phi1 n
→ phi1^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_mu_aux phi2 n
→ phi2^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phi2n' : db_index H : well_formed_closed_mu_aux phi1 n' &&
well_formed_closed_mu_aux phi2 n'
patt_app phi1^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X]
phi2^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X] =
patt_app phi1 phi2
apply andb_true_iff in H.Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_mu_aux phi1 n
→ phi1^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_mu_aux phi2 n
→ phi2^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phi2n' : db_index H : well_formed_closed_mu_aux phi1 n' = true
∧ well_formed_closed_mu_aux phi2 n' = true
patt_app phi1^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X]
phi2^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X] =
patt_app phi1 phi2
destruct H as [H1 H2].Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_mu_aux phi1 n
→ phi1^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_mu_aux phi2 n
→ phi2^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phi2n' : db_index H1 : well_formed_closed_mu_aux phi1 n' = true H2 : well_formed_closed_mu_aux phi2 n' = true
patt_app phi1^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X]
phi2^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X] =
patt_app phi1 phi2
erewrite -> IHphi1, IHphi2 by eassumption .Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_mu_aux phi1 n
→ phi1^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_mu_aux phi2 n
→ phi2^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phi2n' : db_index H1 : well_formed_closed_mu_aux phi1 n' = true H2 : well_formed_closed_mu_aux phi2 n' = true
patt_app phi1 phi2 = patt_app phi1 phi2
reflexivity .
- Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_mu_aux phi1 n
→ phi1^{{svar:X↦n}}^{svar:n↦X} = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_mu_aux phi2 n
→ phi2^{{svar:X↦n}}^{svar:n↦X} = phi2n' : db_index H : well_formed_closed_mu_aux (patt_imp phi1 phi2) n'
patt_imp phi1^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X]
phi2^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X] =
patt_imp phi1 phi2
simpl in H.Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_mu_aux phi1 n
→ phi1^{{svar:X↦n}}^{svar:n↦X} = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_mu_aux phi2 n
→ phi2^{{svar:X↦n}}^{svar:n↦X} = phi2n' : db_index H : well_formed_closed_mu_aux phi1 n' &&
well_formed_closed_mu_aux phi2 n'
patt_imp phi1^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X]
phi2^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X] =
patt_imp phi1 phi2
unfold svar_open in IHphi1, IHphi2.Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_mu_aux phi1 n
→ phi1^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_mu_aux phi2 n
→ phi2^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phi2n' : db_index H : well_formed_closed_mu_aux phi1 n' &&
well_formed_closed_mu_aux phi2 n'
patt_imp phi1^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X]
phi2^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X] =
patt_imp phi1 phi2
apply andb_true_iff in H.Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_mu_aux phi1 n
→ phi1^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_mu_aux phi2 n
→ phi2^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phi2n' : db_index H : well_formed_closed_mu_aux phi1 n' = true
∧ well_formed_closed_mu_aux phi2 n' = true
patt_imp phi1^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X]
phi2^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X] =
patt_imp phi1 phi2
destruct H as [H1 H2].Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_mu_aux phi1 n
→ phi1^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_mu_aux phi2 n
→ phi2^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phi2n' : db_index H1 : well_formed_closed_mu_aux phi1 n' = true H2 : well_formed_closed_mu_aux phi2 n' = true
patt_imp phi1^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X]
phi2^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X] =
patt_imp phi1 phi2
erewrite -> IHphi1, IHphi2 by eassumption .Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : db_index,
well_formed_closed_mu_aux phi1 n
→ phi1^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phi1IHphi2 : ∀ n : db_index,
well_formed_closed_mu_aux phi2 n
→ phi2^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phi2n' : db_index H1 : well_formed_closed_mu_aux phi1 n' = true H2 : well_formed_closed_mu_aux phi2 n' = true
patt_imp phi1 phi2 = patt_imp phi1 phi2
reflexivity .
- Σ : Signature X : svar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_mu_aux phi n
→ phi^{{svar:X↦n}}^{svar:n↦X} = phin' : db_index H : well_formed_closed_mu_aux (patt_exists phi) n'
patt_exists
phi^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X] =
patt_exists phi
simpl in H.Σ : Signature X : svar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_mu_aux phi n
→ phi^{{svar:X↦n}}^{svar:n↦X} = phin' : db_index H : well_formed_closed_mu_aux phi n'
patt_exists
phi^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X] =
patt_exists phi
unfold svar_open in IHphi.Σ : Signature X : svar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_mu_aux phi n
→ phi^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phin' : db_index H : well_formed_closed_mu_aux phi n'
patt_exists
phi^{{svar:X↦n'}}^[svar:n'↦patt_free_svar X] =
patt_exists phi
erewrite -> IHphi by eassumption .Σ : Signature X : svar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_mu_aux phi n
→ phi^{{svar:X↦n}}^[svar:n↦
patt_free_svar X] = phin' : db_index H : well_formed_closed_mu_aux phi n'
patt_exists phi = patt_exists phi
reflexivity .
- Σ : Signature X : svar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_mu_aux phi n
→ phi^{{svar:X↦n}}^{svar:n↦X} = phin' : db_index H : well_formed_closed_mu_aux (patt_mu phi) n'
patt_mu
phi^{{svar:X↦S n'}}^[svar:S n'↦patt_free_svar X] =
patt_mu phi
simpl in H.Σ : Signature X : svar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_mu_aux phi n
→ phi^{{svar:X↦n}}^{svar:n↦X} = phin' : db_index H : well_formed_closed_mu_aux phi (S n')
patt_mu
phi^{{svar:X↦S n'}}^[svar:S n'↦patt_free_svar X] =
patt_mu phi
apply IHphi in H.Σ : Signature X : svar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_mu_aux phi n
→ phi^{{svar:X↦n}}^{svar:n↦X} = phin' : db_index H : phi^{{svar:X↦S n'}}^{svar:S n'↦X} = phi
patt_mu
phi^{{svar:X↦S n'}}^[svar:S n'↦patt_free_svar X] =
patt_mu phi
unfold svar_open in H.Σ : Signature X : svar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_mu_aux phi n
→ phi^{{svar:X↦n}}^{svar:n↦X} = phin' : db_index H : phi^{{svar:X↦S n'}}^[svar:
S n'↦patt_free_svar X] = phi
patt_mu
phi^{{svar:X↦S n'}}^[svar:S n'↦patt_free_svar X] =
patt_mu phi
rewrite H.Σ : Signature X : svar phi : Pattern IHphi : ∀ n : db_index,
well_formed_closed_mu_aux phi n
→ phi^{{svar:X↦n}}^{svar:n↦X} = phin' : db_index H : phi^{{svar:X↦S n'}}^[svar:
S n'↦patt_free_svar X] = phi
patt_mu phi = patt_mu phi
reflexivity .
Qed .
Lemma evar_quantify_evar_open x n phi :
x ∉ free_evars phi -> well_formed_closed_ex_aux phi (S n) ->
((phi^{evar : n ↦ x})^{{evar : x ↦ n}}) = phi.Σ : Signature x : evar n : nat phi : Pattern
x ∉ free_evars phi
→ well_formed_closed_ex_aux phi (S n)
→ phi^{evar :n↦x}^{{evar :x↦n}} = phi
Proof .Σ : Signature x : evar n : nat phi : Pattern
x ∉ free_evars phi
→ well_formed_closed_ex_aux phi (S n)
→ phi^{evar :n↦x}^{{evar :x↦n}} = phi
revert n.Σ : Signature x : evar phi : Pattern
∀ n : nat,
x ∉ free_evars phi
→ well_formed_closed_ex_aux phi (S n)
→ phi^{evar :n↦x}^{{evar :x↦n}} = phi
induction phi; intros n' H0 H1; simpl ; auto .Σ : Signature x, x0 : evar n' : nat H0 : x ∉ free_evars (patt_free_evar x0) H1 : well_formed_closed_ex_aux (patt_free_evar x0)
(S n')
(if decide (x = x0)
then patt_bound_evar n'
else patt_free_evar x0) = patt_free_evar x0
- Σ : Signature x, x0 : evar n' : nat H0 : x ∉ free_evars (patt_free_evar x0) H1 : well_formed_closed_ex_aux (patt_free_evar x0)
(S n')
(if decide (x = x0)
then patt_bound_evar n'
else patt_free_evar x0) = patt_free_evar x0
destruct (decide (x = x0)); simpl .Σ : Signature x, x0 : evar n' : nat H0 : x ∉ free_evars (patt_free_evar x0) H1 : well_formed_closed_ex_aux (patt_free_evar x0)
(S n') e : x = x0
patt_bound_evar n' = patt_free_evar x0
+ Σ : Signature x, x0 : evar n' : nat H0 : x ∉ free_evars (patt_free_evar x0) H1 : well_formed_closed_ex_aux (patt_free_evar x0)
(S n') e : x = x0
patt_bound_evar n' = patt_free_evar x0
subst .Σ : Signature x0 : evar n' : nat H0 : x0 ∉ free_evars (patt_free_evar x0) H1 : well_formed_closed_ex_aux (patt_free_evar x0)
(S n')
patt_bound_evar n' = patt_free_evar x0
simpl in H0.Σ : Signature x0 : evar n' : nat H0 : x0 ∉ {[x0]} H1 : well_formed_closed_ex_aux (patt_free_evar x0)
(S n')
patt_bound_evar n' = patt_free_evar x0
apply sets.not_elem_of_singleton_1 in H0.Σ : Signature x0 : evar n' : nat H0 : x0 ≠ x0 H1 : well_formed_closed_ex_aux (patt_free_evar x0)
(S n')
patt_bound_evar n' = patt_free_evar x0
congruence .
+ Σ : Signature x, x0 : evar n' : nat H0 : x ∉ free_evars (patt_free_evar x0) H1 : well_formed_closed_ex_aux (patt_free_evar x0)
(S n') n : x ≠ x0
patt_free_evar x0 = patt_free_evar x0
reflexivity .
- Σ : Signature x : evar n : db_index n' : nat H0 : x ∉ free_evars (patt_bound_evar n) H1 : well_formed_closed_ex_aux (patt_bound_evar n)
(S n')
(patt_bound_evar n)^{evar :n'↦x}^{{evar :x↦n'}} =
patt_bound_evar n
simpl in *.Σ : Signature x : evar n : db_index n' : nat H0 : x ∉ ∅ H1 : if decide (n < S n') then true else false
(patt_bound_evar n)^{evar :n'↦x}^{{evar :x↦n'}} =
patt_bound_evar n
unfold evar_quantify,evar_open.Σ : Signature x : evar n : db_index n' : nat H0 : x ∉ ∅ H1 : if decide (n < S n') then true else false
(fix evar_quantify
(x : evar ) (level : db_index) (p : Pattern) {struct
p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar x' => patt_bound_evar x'
| patt_bound_svar X => patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app (evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp (evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists (evar_quantify x (S level) p')
| patt_mu p' => patt_mu (evar_quantify x level p')
end ) x n'
(patt_bound_evar n)^[evar :n'↦patt_free_evar x] =
patt_bound_evar n
simpl .Σ : Signature x : evar n : db_index n' : nat H0 : x ∉ ∅ H1 : if decide (n < S n') then true else false
(fix evar_quantify
(x : evar ) (level : db_index) (p : Pattern) {struct
p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar x' => patt_bound_evar x'
| patt_bound_svar X => patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app (evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp (evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists (evar_quantify x (S level) p')
| patt_mu p' => patt_mu (evar_quantify x level p')
end ) x n'
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = patt_bound_evar n
repeat case_match; auto ; try congruence .Σ : Signature x : evar n : db_index n' : nat H0 : x ∉ ∅ l : n < S n' H : decide (n < S n') = left l H1 : true g : n > n' H2 : compare_nat n n' = Nat_greater n n' g
patt_bound_evar (Nat.pred n) = patt_bound_evar n
lia .
- Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
x ∉ free_evars phi1
→ well_formed_closed_ex_aux phi1 (S n)
→ phi1^{evar :n↦x}^{{evar :x↦n}} = phi1IHphi2 : ∀ n : nat,
x ∉ free_evars phi2
→ well_formed_closed_ex_aux phi2 (S n)
→ phi2^{evar :n↦x}^{{evar :x↦n}} = phi2n' : nat H0 : x ∉ free_evars (patt_app phi1 phi2) H1 : well_formed_closed_ex_aux
(patt_app phi1 phi2) (S n')
patt_app phi1^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}}
phi2^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}} =
patt_app phi1 phi2
unfold evar_open in IHphi1, IHphi2.Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
x ∉ free_evars phi1
→ well_formed_closed_ex_aux phi1 (S n)
→ phi1^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi1IHphi2 : ∀ n : nat,
x ∉ free_evars phi2
→ well_formed_closed_ex_aux phi2 (S n)
→ phi2^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi2n' : nat H0 : x ∉ free_evars (patt_app phi1 phi2) H1 : well_formed_closed_ex_aux
(patt_app phi1 phi2) (S n')
patt_app phi1^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}}
phi2^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}} =
patt_app phi1 phi2
rewrite sets.not_elem_of_union in H0.Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
x ∉ free_evars phi1
→ well_formed_closed_ex_aux phi1 (S n)
→ phi1^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi1IHphi2 : ∀ n : nat,
x ∉ free_evars phi2
→ well_formed_closed_ex_aux phi2 (S n)
→ phi2^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi2n' : nat H1 : well_formed_closed_ex_aux
(patt_app phi1 phi2) (S n') H0 : (x
∉ (fix free_evars (phi : Pattern) : EVarSet :=
match phi with
| patt_free_evar x => {[x]}
| patt_app phi1 phi2 |
patt_imp phi1 phi2 =>
free_evars phi1 ∪ free_evars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_evars phi0
| _ => ∅
end ) phi1)
∧ x
∉ (fix free_evars (phi : Pattern) : EVarSet :=
match phi with
| patt_free_evar x => {[x]}
| patt_app phi1 phi2 |
patt_imp phi1 phi2 =>
free_evars phi1 ∪ free_evars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_evars phi0
| _ => ∅
end ) phi2
patt_app phi1^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}}
phi2^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}} =
patt_app phi1 phi2
destruct H0 as [E1 E2].Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
x ∉ free_evars phi1
→ well_formed_closed_ex_aux phi1 (S n)
→ phi1^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi1IHphi2 : ∀ n : nat,
x ∉ free_evars phi2
→ well_formed_closed_ex_aux phi2 (S n)
→ phi2^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi2n' : nat H1 : well_formed_closed_ex_aux
(patt_app phi1 phi2) (S n') E1 : x
∉ (fix free_evars (phi : Pattern) : EVarSet :=
match phi with
| patt_free_evar x => {[x]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_evars phi1 ∪ free_evars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_evars phi0
| _ => ∅
end ) phi1 E2 : x
∉ (fix free_evars (phi : Pattern) : EVarSet :=
match phi with
| patt_free_evar x => {[x]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_evars phi1 ∪ free_evars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_evars phi0
| _ => ∅
end ) phi2
patt_app phi1^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}}
phi2^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}} =
patt_app phi1 phi2
rewrite -> IHphi1, IHphi2.Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
x ∉ free_evars phi1
→ well_formed_closed_ex_aux phi1 (S n)
→ phi1^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi1IHphi2 : ∀ n : nat,
x ∉ free_evars phi2
→ well_formed_closed_ex_aux phi2 (S n)
→ phi2^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi2n' : nat H1 : well_formed_closed_ex_aux
(patt_app phi1 phi2) (S n') E1 : x
∉ (fix free_evars (phi : Pattern) : EVarSet :=
match phi with
| patt_free_evar x => {[x]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_evars phi1 ∪ free_evars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_evars phi0
| _ => ∅
end ) phi1 E2 : x
∉ (fix free_evars (phi : Pattern) : EVarSet :=
match phi with
| patt_free_evar x => {[x]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_evars phi1 ∪ free_evars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_evars phi0
| _ => ∅
end ) phi2
patt_app phi1 phi2 = patt_app phi1 phi2
reflexivity .Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
x ∉ free_evars phi1
→ well_formed_closed_ex_aux phi1 (S n)
→ phi1^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi1IHphi2 : ∀ n : nat,
x ∉ free_evars phi2
→ well_formed_closed_ex_aux phi2 (S n)
→ phi2^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi2n' : nat H1 : well_formed_closed_ex_aux
(patt_app phi1 phi2) (S n') E1 : x
∉ (fix free_evars (phi : Pattern) : EVarSet :=
match phi with
| patt_free_evar x => {[x]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_evars phi1 ∪ free_evars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_evars phi0
| _ => ∅
end ) phi1 E2 : x
∉ (fix free_evars (phi : Pattern) : EVarSet :=
match phi with
| patt_free_evar x => {[x]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_evars phi1 ∪ free_evars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_evars phi0
| _ => ∅
end ) phi2
x ∉ free_evars phi2
all : auto ; apply andb_true_iff in H1; apply H1.
- Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
x ∉ free_evars phi1
→ well_formed_closed_ex_aux phi1 (S n)
→ phi1^{evar :n↦x}^{{evar :x↦n}} = phi1IHphi2 : ∀ n : nat,
x ∉ free_evars phi2
→ well_formed_closed_ex_aux phi2 (S n)
→ phi2^{evar :n↦x}^{{evar :x↦n}} = phi2n' : nat H0 : x ∉ free_evars (patt_imp phi1 phi2) H1 : well_formed_closed_ex_aux
(patt_imp phi1 phi2) (S n')
patt_imp phi1^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}}
phi2^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}} =
patt_imp phi1 phi2
unfold evar_open in IHphi1, IHphi2.Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
x ∉ free_evars phi1
→ well_formed_closed_ex_aux phi1 (S n)
→ phi1^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi1IHphi2 : ∀ n : nat,
x ∉ free_evars phi2
→ well_formed_closed_ex_aux phi2 (S n)
→ phi2^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi2n' : nat H0 : x ∉ free_evars (patt_imp phi1 phi2) H1 : well_formed_closed_ex_aux
(patt_imp phi1 phi2) (S n')
patt_imp phi1^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}}
phi2^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}} =
patt_imp phi1 phi2
rewrite sets.not_elem_of_union in H0.Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
x ∉ free_evars phi1
→ well_formed_closed_ex_aux phi1 (S n)
→ phi1^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi1IHphi2 : ∀ n : nat,
x ∉ free_evars phi2
→ well_formed_closed_ex_aux phi2 (S n)
→ phi2^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi2n' : nat H1 : well_formed_closed_ex_aux
(patt_imp phi1 phi2) (S n') H0 : (x
∉ (fix free_evars (phi : Pattern) : EVarSet :=
match phi with
| patt_free_evar x => {[x]}
| patt_app phi1 phi2 |
patt_imp phi1 phi2 =>
free_evars phi1 ∪ free_evars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_evars phi0
| _ => ∅
end ) phi1)
∧ x
∉ (fix free_evars (phi : Pattern) : EVarSet :=
match phi with
| patt_free_evar x => {[x]}
| patt_app phi1 phi2 |
patt_imp phi1 phi2 =>
free_evars phi1 ∪ free_evars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_evars phi0
| _ => ∅
end ) phi2
patt_imp phi1^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}}
phi2^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}} =
patt_imp phi1 phi2
destruct H0 as [E1 E2].Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
x ∉ free_evars phi1
→ well_formed_closed_ex_aux phi1 (S n)
→ phi1^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi1IHphi2 : ∀ n : nat,
x ∉ free_evars phi2
→ well_formed_closed_ex_aux phi2 (S n)
→ phi2^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi2n' : nat H1 : well_formed_closed_ex_aux
(patt_imp phi1 phi2) (S n') E1 : x
∉ (fix free_evars (phi : Pattern) : EVarSet :=
match phi with
| patt_free_evar x => {[x]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_evars phi1 ∪ free_evars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_evars phi0
| _ => ∅
end ) phi1 E2 : x
∉ (fix free_evars (phi : Pattern) : EVarSet :=
match phi with
| patt_free_evar x => {[x]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_evars phi1 ∪ free_evars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_evars phi0
| _ => ∅
end ) phi2
patt_imp phi1^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}}
phi2^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}} =
patt_imp phi1 phi2
rewrite -> IHphi1, IHphi2.Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
x ∉ free_evars phi1
→ well_formed_closed_ex_aux phi1 (S n)
→ phi1^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi1IHphi2 : ∀ n : nat,
x ∉ free_evars phi2
→ well_formed_closed_ex_aux phi2 (S n)
→ phi2^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi2n' : nat H1 : well_formed_closed_ex_aux
(patt_imp phi1 phi2) (S n') E1 : x
∉ (fix free_evars (phi : Pattern) : EVarSet :=
match phi with
| patt_free_evar x => {[x]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_evars phi1 ∪ free_evars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_evars phi0
| _ => ∅
end ) phi1 E2 : x
∉ (fix free_evars (phi : Pattern) : EVarSet :=
match phi with
| patt_free_evar x => {[x]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_evars phi1 ∪ free_evars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_evars phi0
| _ => ∅
end ) phi2
patt_imp phi1 phi2 = patt_imp phi1 phi2
reflexivity .Σ : Signature x : evar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
x ∉ free_evars phi1
→ well_formed_closed_ex_aux phi1 (S n)
→ phi1^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi1IHphi2 : ∀ n : nat,
x ∉ free_evars phi2
→ well_formed_closed_ex_aux phi2 (S n)
→ phi2^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phi2n' : nat H1 : well_formed_closed_ex_aux
(patt_imp phi1 phi2) (S n') E1 : x
∉ (fix free_evars (phi : Pattern) : EVarSet :=
match phi with
| patt_free_evar x => {[x]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_evars phi1 ∪ free_evars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_evars phi0
| _ => ∅
end ) phi1 E2 : x
∉ (fix free_evars (phi : Pattern) : EVarSet :=
match phi with
| patt_free_evar x => {[x]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_evars phi1 ∪ free_evars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_evars phi0
| _ => ∅
end ) phi2
x ∉ free_evars phi2
all : auto ; apply andb_true_iff in H1; apply H1.
- Σ : Signature x : evar phi : Pattern IHphi : ∀ n : nat,
x ∉ free_evars phi
→ well_formed_closed_ex_aux phi (S n)
→ phi^{evar :n↦x}^{{evar :x↦n}} = phin' : nat H0 : x ∉ free_evars (patt_exists phi) H1 : well_formed_closed_ex_aux
(patt_exists phi) (S n')
patt_exists
phi^[evar :S n'↦patt_free_evar x]^{{evar :x↦S n'}} =
patt_exists phi
simpl in H0.Σ : Signature x : evar phi : Pattern IHphi : ∀ n : nat,
x ∉ free_evars phi
→ well_formed_closed_ex_aux phi (S n)
→ phi^{evar :n↦x}^{{evar :x↦n}} = phin' : nat H0 : x ∉ free_evars phi H1 : well_formed_closed_ex_aux
(patt_exists phi) (S n')
patt_exists
phi^[evar :S n'↦patt_free_evar x]^{{evar :x↦S n'}} =
patt_exists phi
unfold evar_open in IHphi.Σ : Signature x : evar phi : Pattern IHphi : ∀ n : nat,
x ∉ free_evars phi
→ well_formed_closed_ex_aux phi (S n)
→ phi^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phin' : nat H0 : x ∉ free_evars phi H1 : well_formed_closed_ex_aux
(patt_exists phi) (S n')
patt_exists
phi^[evar :S n'↦patt_free_evar x]^{{evar :x↦S n'}} =
patt_exists phi
rewrite -> IHphi by assumption .Σ : Signature x : evar phi : Pattern IHphi : ∀ n : nat,
x ∉ free_evars phi
→ well_formed_closed_ex_aux phi (S n)
→ phi^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phin' : nat H0 : x ∉ free_evars phi H1 : well_formed_closed_ex_aux
(patt_exists phi) (S n')
patt_exists phi = patt_exists phi
reflexivity .
- Σ : Signature x : evar phi : Pattern IHphi : ∀ n : nat,
x ∉ free_evars phi
→ well_formed_closed_ex_aux phi (S n)
→ phi^{evar :n↦x}^{{evar :x↦n}} = phin' : nat H0 : x ∉ free_evars (patt_mu phi) H1 : well_formed_closed_ex_aux (patt_mu phi) (S n')
patt_mu phi^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}} =
patt_mu phi
simpl in H0.Σ : Signature x : evar phi : Pattern IHphi : ∀ n : nat,
x ∉ free_evars phi
→ well_formed_closed_ex_aux phi (S n)
→ phi^{evar :n↦x}^{{evar :x↦n}} = phin' : nat H0 : x ∉ free_evars phi H1 : well_formed_closed_ex_aux (patt_mu phi) (S n')
patt_mu phi^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}} =
patt_mu phi
unfold evar_open in IHphi.Σ : Signature x : evar phi : Pattern IHphi : ∀ n : nat,
x ∉ free_evars phi
→ well_formed_closed_ex_aux phi (S n)
→ phi^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phin' : nat H0 : x ∉ free_evars phi H1 : well_formed_closed_ex_aux (patt_mu phi) (S n')
patt_mu phi^[evar :n'↦patt_free_evar x]^{{evar :x↦n'}} =
patt_mu phi
rewrite -> IHphi by assumption .Σ : Signature x : evar phi : Pattern IHphi : ∀ n : nat,
x ∉ free_evars phi
→ well_formed_closed_ex_aux phi (S n)
→ phi^[evar :n↦patt_free_evar x]^{{evar :x↦n}} =
phin' : nat H0 : x ∉ free_evars phi H1 : well_formed_closed_ex_aux (patt_mu phi) (S n')
patt_mu phi = patt_mu phi
reflexivity .
Qed .
Lemma svar_quantify_svar_open X n phi :
X ∉ free_svars phi -> well_formed_closed_mu_aux phi (S n) ->
((phi^{svar: n ↦ X})^{{svar: X ↦ n}}) = phi.Σ : Signature X : svar n : nat phi : Pattern
X ∉ free_svars phi
→ well_formed_closed_mu_aux phi (S n)
→ phi^{svar:n↦X}^{{svar:X↦n}} = phi
Proof .Σ : Signature X : svar n : nat phi : Pattern
X ∉ free_svars phi
→ well_formed_closed_mu_aux phi (S n)
→ phi^{svar:n↦X}^{{svar:X↦n}} = phi
revert n.Σ : Signature X : svar phi : Pattern
∀ n : nat,
X ∉ free_svars phi
→ well_formed_closed_mu_aux phi (S n)
→ phi^{svar:n↦X}^{{svar:X↦n}} = phi
induction phi; intros n' H0 H1; simpl ; auto .Σ : Signature X, x : svar n' : nat H0 : X ∉ free_svars (patt_free_svar x) H1 : well_formed_closed_mu_aux (patt_free_svar x)
(S n')
(if decide (X = x)
then patt_bound_svar n'
else patt_free_svar x) = patt_free_svar x
- Σ : Signature X, x : svar n' : nat H0 : X ∉ free_svars (patt_free_svar x) H1 : well_formed_closed_mu_aux (patt_free_svar x)
(S n')
(if decide (X = x)
then patt_bound_svar n'
else patt_free_svar x) = patt_free_svar x
destruct (decide (X = x)); simpl .Σ : Signature X, x : svar n' : nat H0 : X ∉ free_svars (patt_free_svar x) H1 : well_formed_closed_mu_aux (patt_free_svar x)
(S n') e : X = x
patt_bound_svar n' = patt_free_svar x
+ Σ : Signature X, x : svar n' : nat H0 : X ∉ free_svars (patt_free_svar x) H1 : well_formed_closed_mu_aux (patt_free_svar x)
(S n') e : X = x
patt_bound_svar n' = patt_free_svar x
subst .Σ : Signature x : svar n' : nat H0 : x ∉ free_svars (patt_free_svar x) H1 : well_formed_closed_mu_aux (patt_free_svar x)
(S n')
patt_bound_svar n' = patt_free_svar x
simpl in H0.Σ : Signature x : svar n' : nat H0 : x ∉ {[x]} H1 : well_formed_closed_mu_aux (patt_free_svar x)
(S n')
patt_bound_svar n' = patt_free_svar x
apply sets.not_elem_of_singleton_1 in H0.Σ : Signature x : svar n' : nat H0 : x ≠ x H1 : well_formed_closed_mu_aux (patt_free_svar x)
(S n')
patt_bound_svar n' = patt_free_svar x
congruence .
+ Σ : Signature X, x : svar n' : nat H0 : X ∉ free_svars (patt_free_svar x) H1 : well_formed_closed_mu_aux (patt_free_svar x)
(S n') n : X ≠ x
patt_free_svar x = patt_free_svar x
reflexivity .
- Σ : Signature X : svar n : db_index n' : nat H0 : X ∉ free_svars (patt_bound_svar n) H1 : well_formed_closed_mu_aux (patt_bound_svar n)
(S n')
(patt_bound_svar n)^{svar:n'↦X}^{{svar:X↦n'}} =
patt_bound_svar n
simpl in *.Σ : Signature X : svar n : db_index n' : nat H0 : X ∉ ∅ H1 : if decide (n < S n') then true else false
(patt_bound_svar n)^{svar:n'↦X}^{{svar:X↦n'}} =
patt_bound_svar n
unfold svar_quantify,svar_open,bsvar_subst.Σ : Signature X : svar n : db_index n' : nat H0 : X ∉ ∅ H1 : if decide (n < S n') then true else false
(fix svar_quantify
(X : svar) (level : db_index) (p : Pattern) {struct
p} : Pattern :=
match p with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar X' =>
if decide (X = X')
then patt_bound_svar level
else patt_free_svar X'
| patt_bound_evar x' => patt_bound_evar x'
| patt_bound_svar X0 => patt_bound_svar X0
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app (svar_quantify X level ls)
(svar_quantify X level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp (svar_quantify X level ls)
(svar_quantify X level rs)
| patt_exists p' =>
patt_exists (svar_quantify X level p')
| patt_mu p' =>
patt_mu (svar_quantify X (S level) p')
end ) X n'
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar X
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end = patt_bound_svar n
repeat case_match; auto ; try congruence .Σ : Signature X : svar n : db_index n' : nat H0 : X ∉ ∅ l : n < S n' H : decide (n < S n') = left l H1 : true g : n > n' H2 : compare_nat n n' = Nat_greater n n' g
patt_bound_svar (Nat.pred n) = patt_bound_svar n
lia .
- Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
X ∉ free_svars phi1
→ well_formed_closed_mu_aux phi1 (S n)
→ phi1^{svar:n↦X}^{{svar:X↦n}} = phi1IHphi2 : ∀ n : nat,
X ∉ free_svars phi2
→ well_formed_closed_mu_aux phi2 (S n)
→ phi2^{svar:n↦X}^{{svar:X↦n}} = phi2n' : nat H0 : X ∉ free_svars (patt_app phi1 phi2) H1 : well_formed_closed_mu_aux
(patt_app phi1 phi2) (S n')
patt_app phi1^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}}
phi2^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}} =
patt_app phi1 phi2
unfold svar_open in IHphi1, IHphi2.Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
X ∉ free_svars phi1
→ well_formed_closed_mu_aux phi1 (S n)
→ phi1^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi1IHphi2 : ∀ n : nat,
X ∉ free_svars phi2
→ well_formed_closed_mu_aux phi2 (S n)
→ phi2^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi2n' : nat H0 : X ∉ free_svars (patt_app phi1 phi2) H1 : well_formed_closed_mu_aux
(patt_app phi1 phi2) (S n')
patt_app phi1^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}}
phi2^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}} =
patt_app phi1 phi2
rewrite sets.not_elem_of_union in H0.Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
X ∉ free_svars phi1
→ well_formed_closed_mu_aux phi1 (S n)
→ phi1^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi1IHphi2 : ∀ n : nat,
X ∉ free_svars phi2
→ well_formed_closed_mu_aux phi2 (S n)
→ phi2^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi2n' : nat H1 : well_formed_closed_mu_aux
(patt_app phi1 phi2) (S n') H0 : (X
∉ (fix free_svars (phi : Pattern) : SVarSet :=
match phi with
| patt_free_svar X => {[X]}
| patt_app phi1 phi2 |
patt_imp phi1 phi2 =>
free_svars phi1 ∪ free_svars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_svars phi0
| _ => ∅
end ) phi1)
∧ X
∉ (fix free_svars (phi : Pattern) : SVarSet :=
match phi with
| patt_free_svar X => {[X]}
| patt_app phi1 phi2 |
patt_imp phi1 phi2 =>
free_svars phi1 ∪ free_svars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_svars phi0
| _ => ∅
end ) phi2
patt_app phi1^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}}
phi2^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}} =
patt_app phi1 phi2
destruct H0 as [E1 E2].Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
X ∉ free_svars phi1
→ well_formed_closed_mu_aux phi1 (S n)
→ phi1^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi1IHphi2 : ∀ n : nat,
X ∉ free_svars phi2
→ well_formed_closed_mu_aux phi2 (S n)
→ phi2^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi2n' : nat H1 : well_formed_closed_mu_aux
(patt_app phi1 phi2) (S n') E1 : X
∉ (fix free_svars (phi : Pattern) : SVarSet :=
match phi with
| patt_free_svar X => {[X]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_svars phi1 ∪ free_svars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_svars phi0
| _ => ∅
end ) phi1 E2 : X
∉ (fix free_svars (phi : Pattern) : SVarSet :=
match phi with
| patt_free_svar X => {[X]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_svars phi1 ∪ free_svars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_svars phi0
| _ => ∅
end ) phi2
patt_app phi1^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}}
phi2^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}} =
patt_app phi1 phi2
rewrite -> IHphi1, IHphi2.Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
X ∉ free_svars phi1
→ well_formed_closed_mu_aux phi1 (S n)
→ phi1^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi1IHphi2 : ∀ n : nat,
X ∉ free_svars phi2
→ well_formed_closed_mu_aux phi2 (S n)
→ phi2^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi2n' : nat H1 : well_formed_closed_mu_aux
(patt_app phi1 phi2) (S n') E1 : X
∉ (fix free_svars (phi : Pattern) : SVarSet :=
match phi with
| patt_free_svar X => {[X]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_svars phi1 ∪ free_svars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_svars phi0
| _ => ∅
end ) phi1 E2 : X
∉ (fix free_svars (phi : Pattern) : SVarSet :=
match phi with
| patt_free_svar X => {[X]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_svars phi1 ∪ free_svars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_svars phi0
| _ => ∅
end ) phi2
patt_app phi1 phi2 = patt_app phi1 phi2
reflexivity .Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
X ∉ free_svars phi1
→ well_formed_closed_mu_aux phi1 (S n)
→ phi1^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi1IHphi2 : ∀ n : nat,
X ∉ free_svars phi2
→ well_formed_closed_mu_aux phi2 (S n)
→ phi2^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi2n' : nat H1 : well_formed_closed_mu_aux
(patt_app phi1 phi2) (S n') E1 : X
∉ (fix free_svars (phi : Pattern) : SVarSet :=
match phi with
| patt_free_svar X => {[X]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_svars phi1 ∪ free_svars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_svars phi0
| _ => ∅
end ) phi1 E2 : X
∉ (fix free_svars (phi : Pattern) : SVarSet :=
match phi with
| patt_free_svar X => {[X]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_svars phi1 ∪ free_svars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_svars phi0
| _ => ∅
end ) phi2
X ∉ free_svars phi2
all : auto ; apply andb_true_iff in H1; apply H1.
- Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
X ∉ free_svars phi1
→ well_formed_closed_mu_aux phi1 (S n)
→ phi1^{svar:n↦X}^{{svar:X↦n}} = phi1IHphi2 : ∀ n : nat,
X ∉ free_svars phi2
→ well_formed_closed_mu_aux phi2 (S n)
→ phi2^{svar:n↦X}^{{svar:X↦n}} = phi2n' : nat H0 : X ∉ free_svars (patt_imp phi1 phi2) H1 : well_formed_closed_mu_aux
(patt_imp phi1 phi2) (S n')
patt_imp phi1^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}}
phi2^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}} =
patt_imp phi1 phi2
unfold svar_open in IHphi1, IHphi2.Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
X ∉ free_svars phi1
→ well_formed_closed_mu_aux phi1 (S n)
→ phi1^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi1IHphi2 : ∀ n : nat,
X ∉ free_svars phi2
→ well_formed_closed_mu_aux phi2 (S n)
→ phi2^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi2n' : nat H0 : X ∉ free_svars (patt_imp phi1 phi2) H1 : well_formed_closed_mu_aux
(patt_imp phi1 phi2) (S n')
patt_imp phi1^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}}
phi2^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}} =
patt_imp phi1 phi2
rewrite sets.not_elem_of_union in H0.Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
X ∉ free_svars phi1
→ well_formed_closed_mu_aux phi1 (S n)
→ phi1^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi1IHphi2 : ∀ n : nat,
X ∉ free_svars phi2
→ well_formed_closed_mu_aux phi2 (S n)
→ phi2^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi2n' : nat H1 : well_formed_closed_mu_aux
(patt_imp phi1 phi2) (S n') H0 : (X
∉ (fix free_svars (phi : Pattern) : SVarSet :=
match phi with
| patt_free_svar X => {[X]}
| patt_app phi1 phi2 |
patt_imp phi1 phi2 =>
free_svars phi1 ∪ free_svars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_svars phi0
| _ => ∅
end ) phi1)
∧ X
∉ (fix free_svars (phi : Pattern) : SVarSet :=
match phi with
| patt_free_svar X => {[X]}
| patt_app phi1 phi2 |
patt_imp phi1 phi2 =>
free_svars phi1 ∪ free_svars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_svars phi0
| _ => ∅
end ) phi2
patt_imp phi1^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}}
phi2^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}} =
patt_imp phi1 phi2
destruct H0 as [E1 E2].Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
X ∉ free_svars phi1
→ well_formed_closed_mu_aux phi1 (S n)
→ phi1^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi1IHphi2 : ∀ n : nat,
X ∉ free_svars phi2
→ well_formed_closed_mu_aux phi2 (S n)
→ phi2^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi2n' : nat H1 : well_formed_closed_mu_aux
(patt_imp phi1 phi2) (S n') E1 : X
∉ (fix free_svars (phi : Pattern) : SVarSet :=
match phi with
| patt_free_svar X => {[X]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_svars phi1 ∪ free_svars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_svars phi0
| _ => ∅
end ) phi1 E2 : X
∉ (fix free_svars (phi : Pattern) : SVarSet :=
match phi with
| patt_free_svar X => {[X]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_svars phi1 ∪ free_svars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_svars phi0
| _ => ∅
end ) phi2
patt_imp phi1^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}}
phi2^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}} =
patt_imp phi1 phi2
rewrite -> IHphi1, IHphi2.Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
X ∉ free_svars phi1
→ well_formed_closed_mu_aux phi1 (S n)
→ phi1^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi1IHphi2 : ∀ n : nat,
X ∉ free_svars phi2
→ well_formed_closed_mu_aux phi2 (S n)
→ phi2^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi2n' : nat H1 : well_formed_closed_mu_aux
(patt_imp phi1 phi2) (S n') E1 : X
∉ (fix free_svars (phi : Pattern) : SVarSet :=
match phi with
| patt_free_svar X => {[X]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_svars phi1 ∪ free_svars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_svars phi0
| _ => ∅
end ) phi1 E2 : X
∉ (fix free_svars (phi : Pattern) : SVarSet :=
match phi with
| patt_free_svar X => {[X]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_svars phi1 ∪ free_svars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_svars phi0
| _ => ∅
end ) phi2
patt_imp phi1 phi2 = patt_imp phi1 phi2
reflexivity .Σ : Signature X : svar phi1, phi2 : Pattern IHphi1 : ∀ n : nat,
X ∉ free_svars phi1
→ well_formed_closed_mu_aux phi1 (S n)
→ phi1^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi1IHphi2 : ∀ n : nat,
X ∉ free_svars phi2
→ well_formed_closed_mu_aux phi2 (S n)
→ phi2^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phi2n' : nat H1 : well_formed_closed_mu_aux
(patt_imp phi1 phi2) (S n') E1 : X
∉ (fix free_svars (phi : Pattern) : SVarSet :=
match phi with
| patt_free_svar X => {[X]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_svars phi1 ∪ free_svars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_svars phi0
| _ => ∅
end ) phi1 E2 : X
∉ (fix free_svars (phi : Pattern) : SVarSet :=
match phi with
| patt_free_svar X => {[X]}
| patt_app phi1 phi2 | patt_imp phi1 phi2 =>
free_svars phi1 ∪ free_svars phi2
| patt_exists phi0 | patt_mu phi0 =>
free_svars phi0
| _ => ∅
end ) phi2
X ∉ free_svars phi2
all : auto ; apply andb_true_iff in H1; apply H1.
- Σ : Signature X : svar phi : Pattern IHphi : ∀ n : nat,
X ∉ free_svars phi
→ well_formed_closed_mu_aux phi (S n)
→ phi^{svar:n↦X}^{{svar:X↦n}} = phin' : nat H0 : X ∉ free_svars (patt_exists phi) H1 : well_formed_closed_mu_aux
(patt_exists phi) (S n')
patt_exists
phi^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}} =
patt_exists phi
simpl in H0.Σ : Signature X : svar phi : Pattern IHphi : ∀ n : nat,
X ∉ free_svars phi
→ well_formed_closed_mu_aux phi (S n)
→ phi^{svar:n↦X}^{{svar:X↦n}} = phin' : nat H0 : X ∉ free_svars phi H1 : well_formed_closed_mu_aux
(patt_exists phi) (S n')
patt_exists
phi^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}} =
patt_exists phi
unfold svar_open in IHphi.Σ : Signature X : svar phi : Pattern IHphi : ∀ n : nat,
X ∉ free_svars phi
→ well_formed_closed_mu_aux phi (S n)
→ phi^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phin' : nat H0 : X ∉ free_svars phi H1 : well_formed_closed_mu_aux
(patt_exists phi) (S n')
patt_exists
phi^[svar:n'↦patt_free_svar X]^{{svar:X↦n'}} =
patt_exists phi
erewrite -> IHphi by assumption .Σ : Signature X : svar phi : Pattern IHphi : ∀ n : nat,
X ∉ free_svars phi
→ well_formed_closed_mu_aux phi (S n)
→ phi^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phin' : nat H0 : X ∉ free_svars phi H1 : well_formed_closed_mu_aux
(patt_exists phi) (S n')
patt_exists phi = patt_exists phi
reflexivity .
- Σ : Signature X : svar phi : Pattern IHphi : ∀ n : nat,
X ∉ free_svars phi
→ well_formed_closed_mu_aux phi (S n)
→ phi^{svar:n↦X}^{{svar:X↦n}} = phin' : nat H0 : X ∉ free_svars (patt_mu phi) H1 : well_formed_closed_mu_aux (patt_mu phi) (S n')
patt_mu
phi^[svar:S n'↦patt_free_svar X]^{{svar:X↦S n'}} =
patt_mu phi
simpl in H0.Σ : Signature X : svar phi : Pattern IHphi : ∀ n : nat,
X ∉ free_svars phi
→ well_formed_closed_mu_aux phi (S n)
→ phi^{svar:n↦X}^{{svar:X↦n}} = phin' : nat H0 : X ∉ free_svars phi H1 : well_formed_closed_mu_aux (patt_mu phi) (S n')
patt_mu
phi^[svar:S n'↦patt_free_svar X]^{{svar:X↦S n'}} =
patt_mu phi
unfold svar_open in IHphi.Σ : Signature X : svar phi : Pattern IHphi : ∀ n : nat,
X ∉ free_svars phi
→ well_formed_closed_mu_aux phi (S n)
→ phi^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phin' : nat H0 : X ∉ free_svars phi H1 : well_formed_closed_mu_aux (patt_mu phi) (S n')
patt_mu
phi^[svar:S n'↦patt_free_svar X]^{{svar:X↦S n'}} =
patt_mu phi
erewrite -> IHphi by assumption .Σ : Signature X : svar phi : Pattern IHphi : ∀ n : nat,
X ∉ free_svars phi
→ well_formed_closed_mu_aux phi (S n)
→ phi^[svar:n↦patt_free_svar X]^{{svar:X↦n}} =
phin' : nat H0 : X ∉ free_svars phi H1 : well_formed_closed_mu_aux (patt_mu phi) (S n')
patt_mu phi = patt_mu phi
reflexivity .
Qed .
Lemma double_evar_quantify φ : forall x n ,
φ^{{evar : x ↦ n}}^{{evar : x ↦ n}} = φ^{{evar : x ↦ n}}.Σ : Signature φ : Pattern
∀ (x : evar ) (n : db_index),
φ^{{evar :x↦n}}^{{evar :x↦n}} = φ^{{evar :x↦n}}
Proof .Σ : Signature φ : Pattern
∀ (x : evar ) (n : db_index),
φ^{{evar :x↦n}}^{{evar :x↦n}} = φ^{{evar :x↦n}}
induction φ; intros x' n'; simpl ; auto .Σ : Signature x, x' : evar n' : db_index
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x)^{{evar :x'↦n'}} =
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x)
* Σ : Signature x, x' : evar n' : db_index
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x)^{{evar :x'↦n'}} =
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x)
unfold evar_quantify.Σ : Signature x, x' : evar n' : db_index
(fix evar_quantify
(x : evar ) (level : db_index) (p : Pattern) {struct
p} : Pattern :=
match p with
| patt_free_evar x' =>
if decide (x = x')
then patt_bound_evar level
else patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar x' => patt_bound_evar x'
| patt_bound_svar X => patt_bound_svar X
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app (evar_quantify x level ls)
(evar_quantify x level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp (evar_quantify x level ls)
(evar_quantify x level rs)
| patt_exists p' =>
patt_exists (evar_quantify x (S level) p')
| patt_mu p' => patt_mu (evar_quantify x level p')
end ) x' n'
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x) =
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x)
repeat case_match; auto .Σ : Signature x, x' : evar n' : db_index n : x' ≠ x e : x' = x H0 : decide (x' = x) = left e H : left e = right n
patt_bound_evar n' = patt_free_evar x
contradiction .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
φ1^{{evar :x↦n}}^{{evar :x↦n}} =
φ1^{{evar :x↦n}}IHφ2 : ∀ (x : evar ) (n : db_index),
φ2^{{evar :x↦n}}^{{evar :x↦n}} =
φ2^{{evar :x↦n}}x' : evar n' : db_index
patt_app φ1^{{evar :x'↦n'}}^{{evar :x'↦n'}}
φ2^{{evar :x'↦n'}}^{{evar :x'↦n'}} =
patt_app φ1^{{evar :x'↦n'}} φ2^{{evar :x'↦n'}}
now rewrite -> IHφ1, -> IHφ2.
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
φ1^{{evar :x↦n}}^{{evar :x↦n}} =
φ1^{{evar :x↦n}}IHφ2 : ∀ (x : evar ) (n : db_index),
φ2^{{evar :x↦n}}^{{evar :x↦n}} =
φ2^{{evar :x↦n}}x' : evar n' : db_index
patt_imp φ1^{{evar :x'↦n'}}^{{evar :x'↦n'}}
φ2^{{evar :x'↦n'}}^{{evar :x'↦n'}} =
patt_imp φ1^{{evar :x'↦n'}} φ2^{{evar :x'↦n'}}
now rewrite -> IHφ1, -> IHφ2.
* Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index), φ^{{evar :x↦n}}^{{evar :x↦n}} = φ^{{evar :x↦n}}x' : evar n' : db_index
patt_exists φ^{{evar :x'↦S n'}}^{{evar :x'↦S n'}} =
patt_exists φ^{{evar :x'↦S n'}}
now rewrite IHφ.
* Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index), φ^{{evar :x↦n}}^{{evar :x↦n}} = φ^{{evar :x↦n}}x' : evar n' : db_index
patt_mu φ^{{evar :x'↦n'}}^{{evar :x'↦n'}} =
patt_mu φ^{{evar :x'↦n'}}
now rewrite IHφ.
Qed .
Lemma double_svar_quantify φ : forall X n ,
φ^{{svar: X ↦ n}}^{{svar: X ↦ n}} = φ^{{svar: X ↦ n}}.Σ : Signature φ : Pattern
∀ (X : svar) (n : db_index),
φ^{{svar:X↦n}}^{{svar:X↦n}} = φ^{{svar:X↦n}}
Proof .Σ : Signature φ : Pattern
∀ (X : svar) (n : db_index),
φ^{{svar:X↦n}}^{{svar:X↦n}} = φ^{{svar:X↦n}}
induction φ; intros x' n'; simpl ; auto .Σ : Signature x, x' : svar n' : db_index
(if decide (x' = x)
then patt_bound_svar n'
else patt_free_svar x)^{{svar:x'↦n'}} =
(if decide (x' = x)
then patt_bound_svar n'
else patt_free_svar x)
* Σ : Signature x, x' : svar n' : db_index
(if decide (x' = x)
then patt_bound_svar n'
else patt_free_svar x)^{{svar:x'↦n'}} =
(if decide (x' = x)
then patt_bound_svar n'
else patt_free_svar x)
unfold svar_quantify.Σ : Signature x, x' : svar n' : db_index
(fix svar_quantify
(X : svar) (level : db_index) (p : Pattern) {struct
p} : Pattern :=
match p with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar X' =>
if decide (X = X')
then patt_bound_svar level
else patt_free_svar X'
| patt_bound_evar x' => patt_bound_evar x'
| patt_bound_svar X0 => patt_bound_svar X0
| patt_sym s => patt_sym s
| patt_app ls rs =>
patt_app (svar_quantify X level ls)
(svar_quantify X level rs)
| patt_bott => patt_bott
| patt_imp ls rs =>
patt_imp (svar_quantify X level ls)
(svar_quantify X level rs)
| patt_exists p' =>
patt_exists (svar_quantify X level p')
| patt_mu p' =>
patt_mu (svar_quantify X (S level) p')
end ) x' n'
(if decide (x' = x)
then patt_bound_svar n'
else patt_free_svar x) =
(if decide (x' = x)
then patt_bound_svar n'
else patt_free_svar x)
repeat case_match; auto .Σ : Signature x, x' : svar n' : db_index n : x' ≠ x e : x' = x H0 : decide (x' = x) = left e H : left e = right n
patt_bound_svar n' = patt_free_svar x
contradiction .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n : db_index),
φ1^{{svar:X↦n}}^{{svar:X↦n}} =
φ1^{{svar:X↦n}}IHφ2 : ∀ (X : svar) (n : db_index),
φ2^{{svar:X↦n}}^{{svar:X↦n}} =
φ2^{{svar:X↦n}}x' : svar n' : db_index
patt_app φ1^{{svar:x'↦n'}}^{{svar:x'↦n'}}
φ2^{{svar:x'↦n'}}^{{svar:x'↦n'}} =
patt_app φ1^{{svar:x'↦n'}} φ2^{{svar:x'↦n'}}
now rewrite -> IHφ1, -> IHφ2.
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n : db_index),
φ1^{{svar:X↦n}}^{{svar:X↦n}} =
φ1^{{svar:X↦n}}IHφ2 : ∀ (X : svar) (n : db_index),
φ2^{{svar:X↦n}}^{{svar:X↦n}} =
φ2^{{svar:X↦n}}x' : svar n' : db_index
patt_imp φ1^{{svar:x'↦n'}}^{{svar:x'↦n'}}
φ2^{{svar:x'↦n'}}^{{svar:x'↦n'}} =
patt_imp φ1^{{svar:x'↦n'}} φ2^{{svar:x'↦n'}}
now rewrite -> IHφ1, -> IHφ2.
* Σ : Signature φ : Pattern IHφ : ∀ (X : svar) (n : db_index), φ^{{svar:X↦n}}^{{svar:X↦n}} = φ^{{svar:X↦n}}x' : svar n' : db_index
patt_exists φ^{{svar:x'↦n'}}^{{svar:x'↦n'}} =
patt_exists φ^{{svar:x'↦n'}}
now rewrite IHφ.
* Σ : Signature φ : Pattern IHφ : ∀ (X : svar) (n : db_index), φ^{{svar:X↦n}}^{{svar:X↦n}} = φ^{{svar:X↦n}}x' : svar n' : db_index
patt_mu φ^{{svar:x'↦S n'}}^{{svar:x'↦S n'}} =
patt_mu φ^{{svar:x'↦S n'}}
now rewrite IHφ.
Qed .
Lemma well_formed_bevar_subst φ : forall ψ n m ,
m >= n -> well_formed_closed_ex_aux φ n ->
(φ^[evar : m ↦ ψ]) = φ.Σ : Signature φ : Pattern
∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ n → φ^[evar :m↦ψ] = φ
Proof .Σ : Signature φ : Pattern
∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ n → φ^[evar :m↦ψ] = φ
induction φ; intros ψ n' m' H H0; simpl ; auto .Σ : Signature n : db_index ψ : Pattern n', m' : nat H : m' ≥ n' H0 : well_formed_closed_ex_aux (patt_bound_evar n) n'
match compare_nat n m' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = patt_bound_evar n
* Σ : Signature n : db_index ψ : Pattern n', m' : nat H : m' ≥ n' H0 : well_formed_closed_ex_aux (patt_bound_evar n) n'
match compare_nat n m' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = patt_bound_evar n
simpl in H0.Σ : Signature n : db_index ψ : Pattern n', m' : nat H : m' ≥ n' H0 : if decide (n < n') then true else false
match compare_nat n m' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = patt_bound_evar n
repeat case_match; auto ; try lia ; congruence .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ1 n
→ φ1^[evar :m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ2 n
→ φ2^[evar :m↦ψ] = φ2ψ : Pattern n', m' : nat H : m' ≥ n' H0 : well_formed_closed_ex_aux (patt_app φ1 φ2) n'
patt_app φ1^[evar :m'↦ψ] φ2^[evar :m'↦ψ] =
patt_app φ1 φ2
simpl in H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ1 n
→ φ1^[evar :m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ2 n
→ φ2^[evar :m↦ψ] = φ2ψ : Pattern n', m' : nat H : m' ≥ n' H0 : well_formed_closed_ex_aux φ1 n' &&
well_formed_closed_ex_aux φ2 n'
patt_app φ1^[evar :m'↦ψ] φ2^[evar :m'↦ψ] =
patt_app φ1 φ2
apply eq_sym, andb_true_eq in H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ1 n
→ φ1^[evar :m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ2 n
→ φ2^[evar :m↦ψ] = φ2ψ : Pattern n', m' : nat H : m' ≥ n' H0 : true = well_formed_closed_ex_aux φ1 n'
∧ true = well_formed_closed_ex_aux φ2 n'
patt_app φ1^[evar :m'↦ψ] φ2^[evar :m'↦ψ] =
patt_app φ1 φ2
destruct H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ1 n
→ φ1^[evar :m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ2 n
→ φ2^[evar :m↦ψ] = φ2ψ : Pattern n', m' : nat H : m' ≥ n' H0 : true = well_formed_closed_ex_aux φ1 n' H1 : true = well_formed_closed_ex_aux φ2 n'
patt_app φ1^[evar :m'↦ψ] φ2^[evar :m'↦ψ] =
patt_app φ1 φ2
erewrite IHφ1, IHφ2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ1 n
→ φ1^[evar :m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ2 n
→ φ2^[evar :m↦ψ] = φ2ψ : Pattern n', m' : nat H : m' ≥ n' H0 : true = well_formed_closed_ex_aux φ1 n' H1 : true = well_formed_closed_ex_aux φ2 n'
patt_app φ1 φ2 = patt_app φ1 φ2
3 : apply eq_sym, H1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ1 n
→ φ1^[evar :m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ2 n
→ φ2^[evar :m↦ψ] = φ2ψ : Pattern n', m' : nat H : m' ≥ n' H0 : true = well_formed_closed_ex_aux φ1 n' H1 : true = well_formed_closed_ex_aux φ2 n'
patt_app φ1 φ2 = patt_app φ1 φ2
4 : apply eq_sym, H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ1 n
→ φ1^[evar :m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ2 n
→ φ2^[evar :m↦ψ] = φ2ψ : Pattern n', m' : nat H : m' ≥ n' H0 : true = well_formed_closed_ex_aux φ1 n' H1 : true = well_formed_closed_ex_aux φ2 n'
patt_app φ1 φ2 = patt_app φ1 φ2
all : auto .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ1 n
→ φ1^[evar :m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ2 n
→ φ2^[evar :m↦ψ] = φ2ψ : Pattern n', m' : nat H : m' ≥ n' H0 : well_formed_closed_ex_aux (patt_imp φ1 φ2) n'
patt_imp φ1^[evar :m'↦ψ] φ2^[evar :m'↦ψ] =
patt_imp φ1 φ2
simpl in H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ1 n
→ φ1^[evar :m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ2 n
→ φ2^[evar :m↦ψ] = φ2ψ : Pattern n', m' : nat H : m' ≥ n' H0 : well_formed_closed_ex_aux φ1 n' &&
well_formed_closed_ex_aux φ2 n'
patt_imp φ1^[evar :m'↦ψ] φ2^[evar :m'↦ψ] =
patt_imp φ1 φ2
apply eq_sym, andb_true_eq in H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ1 n
→ φ1^[evar :m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ2 n
→ φ2^[evar :m↦ψ] = φ2ψ : Pattern n', m' : nat H : m' ≥ n' H0 : true = well_formed_closed_ex_aux φ1 n'
∧ true = well_formed_closed_ex_aux φ2 n'
patt_imp φ1^[evar :m'↦ψ] φ2^[evar :m'↦ψ] =
patt_imp φ1 φ2
destruct H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ1 n
→ φ1^[evar :m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ2 n
→ φ2^[evar :m↦ψ] = φ2ψ : Pattern n', m' : nat H : m' ≥ n' H0 : true = well_formed_closed_ex_aux φ1 n' H1 : true = well_formed_closed_ex_aux φ2 n'
patt_imp φ1^[evar :m'↦ψ] φ2^[evar :m'↦ψ] =
patt_imp φ1 φ2
erewrite IHφ1, IHφ2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ1 n
→ φ1^[evar :m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ2 n
→ φ2^[evar :m↦ψ] = φ2ψ : Pattern n', m' : nat H : m' ≥ n' H0 : true = well_formed_closed_ex_aux φ1 n' H1 : true = well_formed_closed_ex_aux φ2 n'
patt_imp φ1 φ2 = patt_imp φ1 φ2
3 : apply eq_sym, H1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ1 n
→ φ1^[evar :m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ2 n
→ φ2^[evar :m↦ψ] = φ2ψ : Pattern n', m' : nat H : m' ≥ n' H0 : true = well_formed_closed_ex_aux φ1 n' H1 : true = well_formed_closed_ex_aux φ2 n'
patt_imp φ1 φ2 = patt_imp φ1 φ2
4 : apply eq_sym, H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ1 n
→ φ1^[evar :m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (n m : nat),
m ≥ n
→ well_formed_closed_ex_aux φ2 n
→ φ2^[evar :m↦ψ] = φ2ψ : Pattern n', m' : nat H : m' ≥ n' H0 : true = well_formed_closed_ex_aux φ1 n' H1 : true = well_formed_closed_ex_aux φ2 n'
patt_imp φ1 φ2 = patt_imp φ1 φ2
all : auto .
* Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n m : nat),
m ≥ n → well_formed_closed_ex_aux φ n → φ^[evar :m↦ψ] = φψ : Pattern n', m' : nat H : m' ≥ n' H0 : well_formed_closed_ex_aux (patt_exists φ) n'
patt_exists φ^[evar :S m'↦ψ] = patt_exists φ
simpl in H0.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n m : nat),
m ≥ n → well_formed_closed_ex_aux φ n → φ^[evar :m↦ψ] = φψ : Pattern n', m' : nat H : m' ≥ n' H0 : well_formed_closed_ex_aux φ (S n')
patt_exists φ^[evar :S m'↦ψ] = patt_exists φ
erewrite IHφ.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n m : nat),
m ≥ n → well_formed_closed_ex_aux φ n → φ^[evar :m↦ψ] = φψ : Pattern n', m' : nat H : m' ≥ n' H0 : well_formed_closed_ex_aux φ (S n')
patt_exists φ = patt_exists φ
3 : apply H0.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n m : nat),
m ≥ n → well_formed_closed_ex_aux φ n → φ^[evar :m↦ψ] = φψ : Pattern n', m' : nat H : m' ≥ n' H0 : well_formed_closed_ex_aux φ (S n')
patt_exists φ = patt_exists φ
auto .Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n m : nat),
m ≥ n → well_formed_closed_ex_aux φ n → φ^[evar :m↦ψ] = φψ : Pattern n', m' : nat H : m' ≥ n' H0 : well_formed_closed_ex_aux φ (S n')
S m' ≥ S n'
lia .
* Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n m : nat),
m ≥ n → well_formed_closed_ex_aux φ n → φ^[evar :m↦ψ] = φψ : Pattern n', m' : nat H : m' ≥ n' H0 : well_formed_closed_ex_aux (patt_mu φ) n'
patt_mu φ^[evar :m'↦ψ] = patt_mu φ
simpl in H0.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n m : nat),
m ≥ n → well_formed_closed_ex_aux φ n → φ^[evar :m↦ψ] = φψ : Pattern n', m' : nat H : m' ≥ n' H0 : well_formed_closed_ex_aux φ n'
patt_mu φ^[evar :m'↦ψ] = patt_mu φ
erewrite IHφ.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n m : nat),
m ≥ n → well_formed_closed_ex_aux φ n → φ^[evar :m↦ψ] = φψ : Pattern n', m' : nat H : m' ≥ n' H0 : well_formed_closed_ex_aux φ n'
patt_mu φ = patt_mu φ
3 : apply H0.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n m : nat),
m ≥ n → well_formed_closed_ex_aux φ n → φ^[evar :m↦ψ] = φψ : Pattern n', m' : nat H : m' ≥ n' H0 : well_formed_closed_ex_aux φ n'
patt_mu φ = patt_mu φ
all : auto .
Qed .
Lemma well_formed_bsvar_subst φ : forall ψ k m ,
m >= k -> well_formed_closed_mu_aux φ k ->
(φ^[svar: m ↦ ψ]) = φ.Σ : Signature φ : Pattern
∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ k → φ^[svar:m↦ψ] = φ
Proof .Σ : Signature φ : Pattern
∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ k → φ^[svar:m↦ψ] = φ
induction φ; intros ψ k' m' H H0; simpl ; auto .Σ : Signature n : db_index ψ : Pattern k', m' : nat H : m' ≥ k' H0 : well_formed_closed_mu_aux (patt_bound_svar n) k'
match compare_nat n m' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end = patt_bound_svar n
* Σ : Signature n : db_index ψ : Pattern k', m' : nat H : m' ≥ k' H0 : well_formed_closed_mu_aux (patt_bound_svar n) k'
match compare_nat n m' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end = patt_bound_svar n
simpl in H0.Σ : Signature n : db_index ψ : Pattern k', m' : nat H : m' ≥ k' H0 : if decide (n < k') then true else false
match compare_nat n m' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end = patt_bound_svar n
repeat case_match; auto ; try lia ; congruence .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ1 k
→ φ1^[svar:m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ2 k
→ φ2^[svar:m↦ψ] = φ2ψ : Pattern k', m' : nat H : m' ≥ k' H0 : well_formed_closed_mu_aux (patt_app φ1 φ2) k'
patt_app φ1^[svar:m'↦ψ] φ2^[svar:m'↦ψ] =
patt_app φ1 φ2
simpl in H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ1 k
→ φ1^[svar:m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ2 k
→ φ2^[svar:m↦ψ] = φ2ψ : Pattern k', m' : nat H : m' ≥ k' H0 : well_formed_closed_mu_aux φ1 k' &&
well_formed_closed_mu_aux φ2 k'
patt_app φ1^[svar:m'↦ψ] φ2^[svar:m'↦ψ] =
patt_app φ1 φ2
apply eq_sym, andb_true_eq in H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ1 k
→ φ1^[svar:m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ2 k
→ φ2^[svar:m↦ψ] = φ2ψ : Pattern k', m' : nat H : m' ≥ k' H0 : true = well_formed_closed_mu_aux φ1 k'
∧ true = well_formed_closed_mu_aux φ2 k'
patt_app φ1^[svar:m'↦ψ] φ2^[svar:m'↦ψ] =
patt_app φ1 φ2
destruct H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ1 k
→ φ1^[svar:m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ2 k
→ φ2^[svar:m↦ψ] = φ2ψ : Pattern k', m' : nat H : m' ≥ k' H0 : true = well_formed_closed_mu_aux φ1 k' H1 : true = well_formed_closed_mu_aux φ2 k'
patt_app φ1^[svar:m'↦ψ] φ2^[svar:m'↦ψ] =
patt_app φ1 φ2
erewrite IHφ1, IHφ2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ1 k
→ φ1^[svar:m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ2 k
→ φ2^[svar:m↦ψ] = φ2ψ : Pattern k', m' : nat H : m' ≥ k' H0 : true = well_formed_closed_mu_aux φ1 k' H1 : true = well_formed_closed_mu_aux φ2 k'
patt_app φ1 φ2 = patt_app φ1 φ2
3 : apply eq_sym, H1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ1 k
→ φ1^[svar:m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ2 k
→ φ2^[svar:m↦ψ] = φ2ψ : Pattern k', m' : nat H : m' ≥ k' H0 : true = well_formed_closed_mu_aux φ1 k' H1 : true = well_formed_closed_mu_aux φ2 k'
patt_app φ1 φ2 = patt_app φ1 φ2
4 : apply eq_sym, H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ1 k
→ φ1^[svar:m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ2 k
→ φ2^[svar:m↦ψ] = φ2ψ : Pattern k', m' : nat H : m' ≥ k' H0 : true = well_formed_closed_mu_aux φ1 k' H1 : true = well_formed_closed_mu_aux φ2 k'
patt_app φ1 φ2 = patt_app φ1 φ2
all : auto .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ1 k
→ φ1^[svar:m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ2 k
→ φ2^[svar:m↦ψ] = φ2ψ : Pattern k', m' : nat H : m' ≥ k' H0 : well_formed_closed_mu_aux (patt_imp φ1 φ2) k'
patt_imp φ1^[svar:m'↦ψ] φ2^[svar:m'↦ψ] =
patt_imp φ1 φ2
simpl in H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ1 k
→ φ1^[svar:m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ2 k
→ φ2^[svar:m↦ψ] = φ2ψ : Pattern k', m' : nat H : m' ≥ k' H0 : well_formed_closed_mu_aux φ1 k' &&
well_formed_closed_mu_aux φ2 k'
patt_imp φ1^[svar:m'↦ψ] φ2^[svar:m'↦ψ] =
patt_imp φ1 φ2
apply eq_sym, andb_true_eq in H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ1 k
→ φ1^[svar:m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ2 k
→ φ2^[svar:m↦ψ] = φ2ψ : Pattern k', m' : nat H : m' ≥ k' H0 : true = well_formed_closed_mu_aux φ1 k'
∧ true = well_formed_closed_mu_aux φ2 k'
patt_imp φ1^[svar:m'↦ψ] φ2^[svar:m'↦ψ] =
patt_imp φ1 φ2
destruct H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ1 k
→ φ1^[svar:m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ2 k
→ φ2^[svar:m↦ψ] = φ2ψ : Pattern k', m' : nat H : m' ≥ k' H0 : true = well_formed_closed_mu_aux φ1 k' H1 : true = well_formed_closed_mu_aux φ2 k'
patt_imp φ1^[svar:m'↦ψ] φ2^[svar:m'↦ψ] =
patt_imp φ1 φ2
erewrite IHφ1, IHφ2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ1 k
→ φ1^[svar:m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ2 k
→ φ2^[svar:m↦ψ] = φ2ψ : Pattern k', m' : nat H : m' ≥ k' H0 : true = well_formed_closed_mu_aux φ1 k' H1 : true = well_formed_closed_mu_aux φ2 k'
patt_imp φ1 φ2 = patt_imp φ1 φ2
3 : apply eq_sym, H1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ1 k
→ φ1^[svar:m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ2 k
→ φ2^[svar:m↦ψ] = φ2ψ : Pattern k', m' : nat H : m' ≥ k' H0 : true = well_formed_closed_mu_aux φ1 k' H1 : true = well_formed_closed_mu_aux φ2 k'
patt_imp φ1 φ2 = patt_imp φ1 φ2
4 : apply eq_sym, H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ1 k
→ φ1^[svar:m↦ψ] = φ1IHφ2 : ∀ (ψ : Pattern) (k m : nat),
m ≥ k
→ well_formed_closed_mu_aux φ2 k
→ φ2^[svar:m↦ψ] = φ2ψ : Pattern k', m' : nat H : m' ≥ k' H0 : true = well_formed_closed_mu_aux φ1 k' H1 : true = well_formed_closed_mu_aux φ2 k'
patt_imp φ1 φ2 = patt_imp φ1 φ2
all : auto .
* Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (k m : nat),
m ≥ k → well_formed_closed_mu_aux φ k → φ^[svar:m↦ψ] = φψ : Pattern k', m' : nat H : m' ≥ k' H0 : well_formed_closed_mu_aux (patt_exists φ) k'
patt_exists φ^[svar:m'↦ψ] = patt_exists φ
simpl in H0.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (k m : nat),
m ≥ k → well_formed_closed_mu_aux φ k → φ^[svar:m↦ψ] = φψ : Pattern k', m' : nat H : m' ≥ k' H0 : well_formed_closed_mu_aux φ k'
patt_exists φ^[svar:m'↦ψ] = patt_exists φ
erewrite IHφ.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (k m : nat),
m ≥ k → well_formed_closed_mu_aux φ k → φ^[svar:m↦ψ] = φψ : Pattern k', m' : nat H : m' ≥ k' H0 : well_formed_closed_mu_aux φ k'
patt_exists φ = patt_exists φ
3 : apply H0.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (k m : nat),
m ≥ k → well_formed_closed_mu_aux φ k → φ^[svar:m↦ψ] = φψ : Pattern k', m' : nat H : m' ≥ k' H0 : well_formed_closed_mu_aux φ k'
patt_exists φ = patt_exists φ
auto .Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (k m : nat),
m ≥ k → well_formed_closed_mu_aux φ k → φ^[svar:m↦ψ] = φψ : Pattern k', m' : nat H : m' ≥ k' H0 : well_formed_closed_mu_aux φ k'
m' ≥ k'
lia .
* Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (k m : nat),
m ≥ k → well_formed_closed_mu_aux φ k → φ^[svar:m↦ψ] = φψ : Pattern k', m' : nat H : m' ≥ k' H0 : well_formed_closed_mu_aux (patt_mu φ) k'
patt_mu φ^[svar:S m'↦ψ] = patt_mu φ
simpl in H0.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (k m : nat),
m ≥ k → well_formed_closed_mu_aux φ k → φ^[svar:m↦ψ] = φψ : Pattern k', m' : nat H : m' ≥ k' H0 : well_formed_closed_mu_aux φ (S k')
patt_mu φ^[svar:S m'↦ψ] = patt_mu φ
erewrite IHφ.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (k m : nat),
m ≥ k → well_formed_closed_mu_aux φ k → φ^[svar:m↦ψ] = φψ : Pattern k', m' : nat H : m' ≥ k' H0 : well_formed_closed_mu_aux φ (S k')
patt_mu φ = patt_mu φ
3 : apply H0.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (k m : nat),
m ≥ k → well_formed_closed_mu_aux φ k → φ^[svar:m↦ψ] = φψ : Pattern k', m' : nat H : m' ≥ k' H0 : well_formed_closed_mu_aux φ (S k')
patt_mu φ = patt_mu φ
all : auto .Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (k m : nat),
m ≥ k → well_formed_closed_mu_aux φ k → φ^[svar:m↦ψ] = φψ : Pattern k', m' : nat H : m' ≥ k' H0 : well_formed_closed_mu_aux φ (S k')
S m' ≥ S k'
lia .
Qed .
(* bevar_subst is identity if n does not occur in phi *)
Corollary bevar_subst_not_occur n ψ ϕ :
well_formed_closed_ex_aux ϕ n ->
(ϕ^[evar : n ↦ ψ]) = ϕ.Σ : Signature n : db_index ψ, ϕ : Pattern
well_formed_closed_ex_aux ϕ n → ϕ^[evar :n↦ψ] = ϕ
Proof .Σ : Signature n : db_index ψ, ϕ : Pattern
well_formed_closed_ex_aux ϕ n → ϕ^[evar :n↦ψ] = ϕ
intro H.Σ : Signature n : db_index ψ, ϕ : Pattern H : well_formed_closed_ex_aux ϕ n
ϕ^[evar :n↦ψ] = ϕ
eapply well_formed_bevar_subst; eauto .
Qed .
(* evar_open is identity if n does not occur in phi *)
Corollary evar_open_not_occur n x ϕ :
well_formed_closed_ex_aux ϕ n ->
ϕ^{evar : n ↦ x} = ϕ.Σ : Signature n : db_index x : evar ϕ : Pattern
well_formed_closed_ex_aux ϕ n → ϕ^{evar :n↦x} = ϕ
Proof .Σ : Signature n : db_index x : evar ϕ : Pattern
well_formed_closed_ex_aux ϕ n → ϕ^{evar :n↦x} = ϕ
apply bevar_subst_not_occur.
Qed .
(* bsvar_subst is identity if n does not occur in phi *)
Corollary bsvar_subst_not_occur n ψ ϕ :
well_formed_closed_mu_aux ϕ n ->
(ϕ^[svar: n ↦ ψ]) = ϕ.Σ : Signature n : db_index ψ, ϕ : Pattern
well_formed_closed_mu_aux ϕ n → ϕ^[svar:n↦ψ] = ϕ
Proof .Σ : Signature n : db_index ψ, ϕ : Pattern
well_formed_closed_mu_aux ϕ n → ϕ^[svar:n↦ψ] = ϕ
intro H.Σ : Signature n : db_index ψ, ϕ : Pattern H : well_formed_closed_mu_aux ϕ n
ϕ^[svar:n↦ψ] = ϕ
eapply well_formed_bsvar_subst; eauto .
Qed .
(* evar_open is identity if n does not occur in phi *)
Corollary svar_open_not_occur n x ϕ :
well_formed_closed_mu_aux ϕ n ->
ϕ^{svar: n ↦ x} = ϕ.Σ : Signature n : db_index x : svar ϕ : Pattern
well_formed_closed_mu_aux ϕ n → ϕ^{svar:n↦x} = ϕ
Proof .Σ : Signature n : db_index x : svar ϕ : Pattern
well_formed_closed_mu_aux ϕ n → ϕ^{svar:n↦x} = ϕ
apply bsvar_subst_not_occur.
Qed .
(* opening on closed patterns is identity *)
Lemma evar_open_closed :
forall phi ,
well_formed_closed_ex_aux phi 0 ->
forall n v ,
phi^{evar : n ↦ v} = phi.Σ : Signature
∀ phi : Pattern,
well_formed_closed_ex_aux phi 0
→ ∀ (n : db_index) (v : evar ), phi^{evar :n↦v} = phi
Proof .Σ : Signature
∀ phi : Pattern,
well_formed_closed_ex_aux phi 0
→ ∀ (n : db_index) (v : evar ), phi^{evar :n↦v} = phi
intros phi H n v.Σ : Signature phi : Pattern H : well_formed_closed_ex_aux phi 0 n : db_index v : evar
phi^{evar :n↦v} = phi
unfold evar_open.Σ : Signature phi : Pattern H : well_formed_closed_ex_aux phi 0 n : db_index v : evar
phi^[evar :n↦patt_free_evar v] = phi
erewrite well_formed_bevar_subst.Σ : Signature phi : Pattern H : well_formed_closed_ex_aux phi 0 n : db_index v : evar
phi = phi
3 : exact H.Σ : Signature phi : Pattern H : well_formed_closed_ex_aux phi 0 n : db_index v : evar
phi = phi
auto .Σ : Signature phi : Pattern H : well_formed_closed_ex_aux phi 0 n : db_index v : evar
n ≥ 0
lia .
Qed .
Lemma svar_open_closed :
forall phi ,
well_formed_closed_mu_aux phi 0 ->
forall n v ,
phi^{svar: n ↦ v} = phi.Σ : Signature
∀ phi : Pattern,
well_formed_closed_mu_aux phi 0
→ ∀ (n : db_index) (v : svar), phi^{svar:n↦v} = phi
Proof .Σ : Signature
∀ phi : Pattern,
well_formed_closed_mu_aux phi 0
→ ∀ (n : db_index) (v : svar), phi^{svar:n↦v} = phi
intros phi H n v.Σ : Signature phi : Pattern H : well_formed_closed_mu_aux phi 0 n : db_index v : svar
phi^{svar:n↦v} = phi
unfold svar_open.Σ : Signature phi : Pattern H : well_formed_closed_mu_aux phi 0 n : db_index v : svar
phi^[svar:n↦patt_free_svar v] = phi
erewrite well_formed_bsvar_subst.Σ : Signature phi : Pattern H : well_formed_closed_mu_aux phi 0 n : db_index v : svar
phi = phi
3 : exact H.Σ : Signature phi : Pattern H : well_formed_closed_mu_aux phi 0 n : db_index v : svar
phi = phi
auto .Σ : Signature phi : Pattern H : well_formed_closed_mu_aux phi 0 n : db_index v : svar
n ≥ 0
lia .
Qed .
Lemma bevar_subst_comm_higher :
forall phi psi1 psi2 n m ,
n > m -> well_formed_closed_ex_aux psi1 0 -> well_formed_closed_ex_aux psi2 0 ->
(phi^[evar : n ↦ psi1])^[evar : m ↦ psi2] =
(phi^[evar : m ↦ psi2])^[evar : pred n ↦ psi1].Σ : Signature
∀ (phi psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi^[evar :n↦psi1]^[evar :m↦psi2] =
phi^[evar :m↦psi2]^[evar :Init.Nat.pred n↦psi1]
Proof .Σ : Signature
∀ (phi psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi^[evar :n↦psi1]^[evar :m↦psi2] =
phi^[evar :m↦psi2]^[evar :Init.Nat.pred n↦psi1]
induction phi; intros psi1 psi2 n0 m0 NEQ Hwf1 Hwf2; simpl ; auto .Σ : Signature n : db_index psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0
match compare_nat n n0 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi1
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end ^[evar :m0↦psi2] =
match compare_nat n m0 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi2
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end ^[evar :Init.Nat.pred n0↦psi1]
- Σ : Signature n : db_index psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0
match compare_nat n n0 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi1
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end ^[evar :m0↦psi2] =
match compare_nat n m0 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi2
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end ^[evar :Init.Nat.pred n0↦psi1]
repeat case_match; simpl ; try rewrite -> Heqc; try rewrite -> Heqc0; auto ; subst ; try congruence .Σ : Signature n : db_index psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0 l : n < n0 H : compare_nat n n0 = Nat_less n n0 l l0 : n < m0 H0 : compare_nat n m0 = Nat_less n m0 l0
match compare_nat n m0 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi2
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end =
match compare_nat n (Init.Nat.pred n0) with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi1
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end
all : repeat case_match; try lia ; auto .Σ : Signature psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0 l : m0 < n0 H : compare_nat m0 n0 = Nat_less m0 n0 l e : m0 = m0 H1 : compare_nat m0 m0 = Nat_equal m0 m0 e H0 : Nat_equal m0 m0 e = Nat_equal m0 m0 (erefl m0)
psi2 = psi2^[evar :Init.Nat.pred n0↦psi1]
1 -2 : subst ; erewrite well_formed_bevar_subst; try eassumption ; auto ; lia .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi1^[evar :n↦psi1]^[evar :m↦psi2] =
phi1^[evar :m↦psi2]^[evar :
Init.Nat.pred n↦psi1]IHphi2 : ∀ (psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi2^[evar :n↦psi1]^[evar :m↦psi2] =
phi2^[evar :m↦psi2]^[evar :
Init.Nat.pred n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0
patt_app phi1^[evar :n0↦psi1]^[evar :m0↦psi2]
phi2^[evar :n0↦psi1]^[evar :m0↦psi2] =
patt_app
phi1^[evar :m0↦psi2]^[evar :Init.Nat.pred n0↦psi1]
phi2^[evar :m0↦psi2]^[evar :Init.Nat.pred n0↦psi1]
rewrite -> IHphi1, -> IHphi2; auto .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi1^[evar :n↦psi1]^[evar :m↦psi2] =
phi1^[evar :m↦psi2]^[evar :
Init.Nat.pred n↦psi1]IHphi2 : ∀ (psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi2^[evar :n↦psi1]^[evar :m↦psi2] =
phi2^[evar :m↦psi2]^[evar :
Init.Nat.pred n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0
patt_imp phi1^[evar :n0↦psi1]^[evar :m0↦psi2]
phi2^[evar :n0↦psi1]^[evar :m0↦psi2] =
patt_imp
phi1^[evar :m0↦psi2]^[evar :Init.Nat.pred n0↦psi1]
phi2^[evar :m0↦psi2]^[evar :Init.Nat.pred n0↦psi1]
rewrite -> IHphi1, -> IHphi2; auto .
- Σ : Signature phi : Pattern IHphi : ∀ (psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi^[evar :n↦psi1]^[evar :m↦psi2] =
phi^[evar :m↦psi2]^[evar :
Init.Nat.pred n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0
patt_exists phi^[evar :S n0↦psi1]^[evar :S m0↦psi2] =
patt_exists
phi^[evar :S m0↦psi2]^[evar :S (Init.Nat.pred n0)↦psi1]
rewrite -> IHphi; auto ; try lia .Σ : Signature phi : Pattern IHphi : ∀ (psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi^[evar :n↦psi1]^[evar :m↦psi2] =
phi^[evar :m↦psi2]^[evar :
Init.Nat.pred n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0
patt_exists
phi^[evar :S m0↦psi2]^[evar :Init.Nat.pred (S n0)↦psi1] =
patt_exists
phi^[evar :S m0↦psi2]^[evar :S (Init.Nat.pred n0)↦psi1]
replace (pred (S n0)) with n0 by lia .Σ : Signature phi : Pattern IHphi : ∀ (psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi^[evar :n↦psi1]^[evar :m↦psi2] =
phi^[evar :m↦psi2]^[evar :
Init.Nat.pred n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0
patt_exists phi^[evar :S m0↦psi2]^[evar :n0↦psi1] =
patt_exists
phi^[evar :S m0↦psi2]^[evar :S (Init.Nat.pred n0)↦psi1]
now replace (S (pred n0)) with n0 by lia .
- Σ : Signature phi : Pattern IHphi : ∀ (psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi^[evar :n↦psi1]^[evar :m↦psi2] =
phi^[evar :m↦psi2]^[evar :
Init.Nat.pred n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0
patt_mu phi^[evar :n0↦psi1]^[evar :m0↦psi2] =
patt_mu
phi^[evar :m0↦psi2]^[evar :Init.Nat.pred n0↦psi1]
rewrite -> IHphi; auto .
Qed .
Lemma bevar_subst_comm_lower :
forall phi psi1 psi2 n m ,
n < m -> well_formed_closed_ex_aux psi1 0 -> well_formed_closed_ex_aux psi2 0 ->
(phi^[evar : n ↦ psi1])^[evar : m ↦ psi2] =
(phi^[evar : S m ↦ psi2])^[evar : n ↦ psi1].Σ : Signature
∀ (phi psi1 psi2 : Pattern) (n m : nat),
n < m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi^[evar :n↦psi1]^[evar :m↦psi2] =
phi^[evar :S m↦psi2]^[evar :n↦psi1]
Proof .Σ : Signature
∀ (phi psi1 psi2 : Pattern) (n m : nat),
n < m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi^[evar :n↦psi1]^[evar :m↦psi2] =
phi^[evar :S m↦psi2]^[evar :n↦psi1]
induction phi; intros psi1 psi2 n0 m0 NEQ Hwf1 Hwf2; simpl ; auto .Σ : Signature n : db_index psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0
match compare_nat n n0 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi1
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end ^[evar :m0↦psi2] =
match compare_nat n (S m0) with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi2
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end ^[evar :n0↦psi1]
- Σ : Signature n : db_index psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0
match compare_nat n n0 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi1
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end ^[evar :m0↦psi2] =
match compare_nat n (S m0) with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi2
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end ^[evar :n0↦psi1]
repeat case_match; simpl ; try rewrite -> Heqc; try rewrite -> Heqc0; auto ; subst ; try congruence .Σ : Signature n : db_index psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0 l : n < n0 H : compare_nat n n0 = Nat_less n n0 l l0 : n < S m0 H0 : compare_nat n (S m0) = Nat_less n (S m0) l0
match compare_nat n m0 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi2
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end =
match compare_nat n n0 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi1
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end
all : repeat case_match; try lia ; auto .Σ : Signature psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0 l : n0 < S m0 H0 : compare_nat n0 (S m0) = Nat_less n0 (S m0) l e : n0 = n0 H1 : compare_nat n0 n0 = Nat_equal n0 n0 e H : Nat_equal n0 n0 e = Nat_equal n0 n0 (erefl n0)
psi1^[evar :m0↦psi2] = psi1
1 -2 : subst ; erewrite well_formed_bevar_subst; try eassumption ; auto .Σ : Signature psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0 l : n0 < S m0 H0 : compare_nat n0 (S m0) = Nat_less n0 (S m0) l e : n0 = n0 H1 : compare_nat n0 n0 = Nat_equal n0 n0 e H : Nat_equal n0 n0 e = Nat_equal n0 n0 (erefl n0)
well_formed_closed_ex_aux psi1 (S n0)
2 : lia .Σ : Signature psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0 l : n0 < S m0 H0 : compare_nat n0 (S m0) = Nat_less n0 (S m0) l e : n0 = n0 H1 : compare_nat n0 n0 = Nat_equal n0 n0 e H : Nat_equal n0 n0 e = Nat_equal n0 n0 (erefl n0)
well_formed_closed_ex_aux psi1 (S n0)
eapply well_formed_closed_ex_aux_ind.Σ : Signature psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0 l : n0 < S m0 H0 : compare_nat n0 (S m0) = Nat_less n0 (S m0) l e : n0 = n0 H1 : compare_nat n0 n0 = Nat_equal n0 n0 e H : Nat_equal n0 n0 e = Nat_equal n0 n0 (erefl n0)
?ind_evar1 ≤ S n0
2 : exact Hwf1.Σ : Signature psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0 l : n0 < S m0 H0 : compare_nat n0 (S m0) = Nat_less n0 (S m0) l e : n0 = n0 H1 : compare_nat n0 n0 = Nat_equal n0 n0 e H : Nat_equal n0 n0 e = Nat_equal n0 n0 (erefl n0)
0 ≤ S n0
lia .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi1 psi2 : Pattern) (n m : nat),
n < m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi1^[evar :n↦psi1]^[evar :m↦psi2] =
phi1^[evar :S m↦psi2]^[evar :n↦psi1]IHphi2 : ∀ (psi1 psi2 : Pattern) (n m : nat),
n < m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi2^[evar :n↦psi1]^[evar :m↦psi2] =
phi2^[evar :S m↦psi2]^[evar :n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0
patt_app phi1^[evar :n0↦psi1]^[evar :m0↦psi2]
phi2^[evar :n0↦psi1]^[evar :m0↦psi2] =
patt_app phi1^[evar :S m0↦psi2]^[evar :n0↦psi1]
phi2^[evar :S m0↦psi2]^[evar :n0↦psi1]
rewrite -> IHphi1, -> IHphi2; auto .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi1 psi2 : Pattern) (n m : nat),
n < m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi1^[evar :n↦psi1]^[evar :m↦psi2] =
phi1^[evar :S m↦psi2]^[evar :n↦psi1]IHphi2 : ∀ (psi1 psi2 : Pattern) (n m : nat),
n < m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi2^[evar :n↦psi1]^[evar :m↦psi2] =
phi2^[evar :S m↦psi2]^[evar :n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0
patt_imp phi1^[evar :n0↦psi1]^[evar :m0↦psi2]
phi2^[evar :n0↦psi1]^[evar :m0↦psi2] =
patt_imp phi1^[evar :S m0↦psi2]^[evar :n0↦psi1]
phi2^[evar :S m0↦psi2]^[evar :n0↦psi1]
rewrite -> IHphi1, -> IHphi2; auto .
- Σ : Signature phi : Pattern IHphi : ∀ (psi1 psi2 : Pattern) (n m : nat),
n < m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi^[evar :n↦psi1]^[evar :m↦psi2] =
phi^[evar :S m↦psi2]^[evar :n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0
patt_exists phi^[evar :S n0↦psi1]^[evar :S m0↦psi2] =
patt_exists phi^[evar :S (S m0)↦psi2]^[evar :S n0↦psi1]
rewrite -> IHphi; auto ; try lia .
- Σ : Signature phi : Pattern IHphi : ∀ (psi1 psi2 : Pattern) (n m : nat),
n < m
→ well_formed_closed_ex_aux psi1 0
→ well_formed_closed_ex_aux psi2 0
→ phi^[evar :n↦psi1]^[evar :m↦psi2] =
phi^[evar :S m↦psi2]^[evar :n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_ex_aux psi2 0
patt_mu phi^[evar :n0↦psi1]^[evar :m0↦psi2] =
patt_mu phi^[evar :S m0↦psi2]^[evar :n0↦psi1]
rewrite -> IHphi; auto .
Qed .
Lemma bsvar_subst_comm_higher :
forall phi psi1 psi2 n m ,
n > m -> well_formed_closed_mu_aux psi1 0 -> well_formed_closed_mu_aux psi2 0 ->
(phi^[svar: n ↦ psi1])^[svar: m ↦ psi2] =
(phi^[svar: m ↦ psi2])^[svar: pred n ↦ psi1].Σ : Signature
∀ (phi psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi^[svar:n↦psi1]^[svar:m↦psi2] =
phi^[svar:m↦psi2]^[svar:Init.Nat.pred n↦psi1]
Proof .Σ : Signature
∀ (phi psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi^[svar:n↦psi1]^[svar:m↦psi2] =
phi^[svar:m↦psi2]^[svar:Init.Nat.pred n↦psi1]
induction phi; intros psi1 psi2 n0 m0 NEQ Hwf1 Hwf2; simpl ; auto .Σ : Signature n : db_index psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0
match compare_nat n n0 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi1
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end ^[svar:m0↦psi2] =
match compare_nat n m0 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi2
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end ^[svar:Init.Nat.pred n0↦psi1]
- Σ : Signature n : db_index psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0
match compare_nat n n0 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi1
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end ^[svar:m0↦psi2] =
match compare_nat n m0 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi2
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end ^[svar:Init.Nat.pred n0↦psi1]
repeat case_match; simpl ; try rewrite -> Heqc; try rewrite -> Heqc0; auto ; subst ; try congruence .Σ : Signature n : db_index psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0 l : n < n0 H : compare_nat n n0 = Nat_less n n0 l l0 : n < m0 H0 : compare_nat n m0 = Nat_less n m0 l0
match compare_nat n m0 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi2
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end =
match compare_nat n (Init.Nat.pred n0) with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi1
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end
all : repeat case_match; try lia ; auto .Σ : Signature psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0 l : m0 < n0 H : compare_nat m0 n0 = Nat_less m0 n0 l e : m0 = m0 H1 : compare_nat m0 m0 = Nat_equal m0 m0 e H0 : Nat_equal m0 m0 e = Nat_equal m0 m0 (erefl m0)
psi2 = psi2^[svar:Init.Nat.pred n0↦psi1]
1 -2 : subst ; erewrite well_formed_bsvar_subst; try eassumption ; auto ; lia .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi1^[svar:n↦psi1]^[svar:m↦psi2] =
phi1^[svar:m↦psi2]^[svar:
Init.Nat.pred n↦psi1]IHphi2 : ∀ (psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi2^[svar:n↦psi1]^[svar:m↦psi2] =
phi2^[svar:m↦psi2]^[svar:
Init.Nat.pred n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0
patt_app phi1^[svar:n0↦psi1]^[svar:m0↦psi2]
phi2^[svar:n0↦psi1]^[svar:m0↦psi2] =
patt_app
phi1^[svar:m0↦psi2]^[svar:Init.Nat.pred n0↦psi1]
phi2^[svar:m0↦psi2]^[svar:Init.Nat.pred n0↦psi1]
rewrite -> IHphi1, -> IHphi2; auto .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi1^[svar:n↦psi1]^[svar:m↦psi2] =
phi1^[svar:m↦psi2]^[svar:
Init.Nat.pred n↦psi1]IHphi2 : ∀ (psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi2^[svar:n↦psi1]^[svar:m↦psi2] =
phi2^[svar:m↦psi2]^[svar:
Init.Nat.pred n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0
patt_imp phi1^[svar:n0↦psi1]^[svar:m0↦psi2]
phi2^[svar:n0↦psi1]^[svar:m0↦psi2] =
patt_imp
phi1^[svar:m0↦psi2]^[svar:Init.Nat.pred n0↦psi1]
phi2^[svar:m0↦psi2]^[svar:Init.Nat.pred n0↦psi1]
rewrite -> IHphi1, -> IHphi2; auto .
- Σ : Signature phi : Pattern IHphi : ∀ (psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi^[svar:n↦psi1]^[svar:m↦psi2] =
phi^[svar:m↦psi2]^[svar:
Init.Nat.pred n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0
patt_exists phi^[svar:n0↦psi1]^[svar:m0↦psi2] =
patt_exists
phi^[svar:m0↦psi2]^[svar:Init.Nat.pred n0↦psi1]
rewrite -> IHphi; auto .
- Σ : Signature phi : Pattern IHphi : ∀ (psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi^[svar:n↦psi1]^[svar:m↦psi2] =
phi^[svar:m↦psi2]^[svar:
Init.Nat.pred n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0
patt_mu phi^[svar:S n0↦psi1]^[svar:S m0↦psi2] =
patt_mu
phi^[svar:S m0↦psi2]^[svar:S (Init.Nat.pred n0)↦psi1]
rewrite -> IHphi; auto .Σ : Signature phi : Pattern IHphi : ∀ (psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi^[svar:n↦psi1]^[svar:m↦psi2] =
phi^[svar:m↦psi2]^[svar:
Init.Nat.pred n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0
patt_mu
phi^[svar:S m0↦psi2]^[svar:Init.Nat.pred (S n0)↦psi1] =
patt_mu
phi^[svar:S m0↦psi2]^[svar:S (Init.Nat.pred n0)↦psi1]
2 : lia .Σ : Signature phi : Pattern IHphi : ∀ (psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi^[svar:n↦psi1]^[svar:m↦psi2] =
phi^[svar:m↦psi2]^[svar:
Init.Nat.pred n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0
patt_mu
phi^[svar:S m0↦psi2]^[svar:Init.Nat.pred (S n0)↦psi1] =
patt_mu
phi^[svar:S m0↦psi2]^[svar:S (Init.Nat.pred n0)↦psi1]
replace (pred (S n0)) with n0 by lia .Σ : Signature phi : Pattern IHphi : ∀ (psi1 psi2 : Pattern) (n m : nat),
n > m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi^[svar:n↦psi1]^[svar:m↦psi2] =
phi^[svar:m↦psi2]^[svar:
Init.Nat.pred n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 > m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0
patt_mu phi^[svar:S m0↦psi2]^[svar:n0↦psi1] =
patt_mu
phi^[svar:S m0↦psi2]^[svar:S (Init.Nat.pred n0)↦psi1]
now replace (S (pred n0)) with n0 by lia .
Qed .
Lemma bsvar_subst_comm_lower :
forall phi psi1 psi2 n m ,
n < m -> well_formed_closed_mu_aux psi1 0 -> well_formed_closed_mu_aux psi2 0 ->
(phi^[svar: n ↦ psi1])^[svar: m ↦ psi2] =
(phi^[svar: S m ↦ psi2])^[svar: n ↦ psi1].Σ : Signature
∀ (phi psi1 psi2 : Pattern) (n m : nat),
n < m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi^[svar:n↦psi1]^[svar:m↦psi2] =
phi^[svar:S m↦psi2]^[svar:n↦psi1]
Proof .Σ : Signature
∀ (phi psi1 psi2 : Pattern) (n m : nat),
n < m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi^[svar:n↦psi1]^[svar:m↦psi2] =
phi^[svar:S m↦psi2]^[svar:n↦psi1]
induction phi; intros psi1 psi2 n0 m0 NEQ Hwf1 Hwf2; simpl ; auto .Σ : Signature n : db_index psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0
match compare_nat n n0 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi1
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end ^[svar:m0↦psi2] =
match compare_nat n (S m0) with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi2
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end ^[svar:n0↦psi1]
- Σ : Signature n : db_index psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0
match compare_nat n n0 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi1
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end ^[svar:m0↦psi2] =
match compare_nat n (S m0) with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi2
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end ^[svar:n0↦psi1]
repeat case_match; simpl ; try rewrite -> Heqc; try rewrite -> Heqc0; auto ; subst ; try congruence .Σ : Signature n : db_index psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0 l : n < n0 H : compare_nat n n0 = Nat_less n n0 l l0 : n < S m0 H0 : compare_nat n (S m0) = Nat_less n (S m0) l0
match compare_nat n m0 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi2
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end =
match compare_nat n n0 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi1
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end
all : repeat case_match; try lia ; auto .Σ : Signature psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0 l : n0 < S m0 H0 : compare_nat n0 (S m0) = Nat_less n0 (S m0) l e : n0 = n0 H1 : compare_nat n0 n0 = Nat_equal n0 n0 e H : Nat_equal n0 n0 e = Nat_equal n0 n0 (erefl n0)
psi1^[svar:m0↦psi2] = psi1
1 -2 : subst ; erewrite well_formed_bsvar_subst; try eassumption ; auto .Σ : Signature psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0 l : n0 < S m0 H0 : compare_nat n0 (S m0) = Nat_less n0 (S m0) l e : n0 = n0 H1 : compare_nat n0 n0 = Nat_equal n0 n0 e H : Nat_equal n0 n0 e = Nat_equal n0 n0 (erefl n0)
well_formed_closed_mu_aux psi1 (S n0)
2 : lia .Σ : Signature psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0 l : n0 < S m0 H0 : compare_nat n0 (S m0) = Nat_less n0 (S m0) l e : n0 = n0 H1 : compare_nat n0 n0 = Nat_equal n0 n0 e H : Nat_equal n0 n0 e = Nat_equal n0 n0 (erefl n0)
well_formed_closed_mu_aux psi1 (S n0)
eapply well_formed_closed_mu_aux_ind.Σ : Signature psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0 l : n0 < S m0 H0 : compare_nat n0 (S m0) = Nat_less n0 (S m0) l e : n0 = n0 H1 : compare_nat n0 n0 = Nat_equal n0 n0 e H : Nat_equal n0 n0 e = Nat_equal n0 n0 (erefl n0)
?ind_svar1 ≤ S n0
2 : exact Hwf1.Σ : Signature psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0 l : n0 < S m0 H0 : compare_nat n0 (S m0) = Nat_less n0 (S m0) l e : n0 = n0 H1 : compare_nat n0 n0 = Nat_equal n0 n0 e H : Nat_equal n0 n0 e = Nat_equal n0 n0 (erefl n0)
0 ≤ S n0
lia .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi1 psi2 : Pattern) (n m : nat),
n < m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi1^[svar:n↦psi1]^[svar:m↦psi2] =
phi1^[svar:S m↦psi2]^[svar:n↦psi1]IHphi2 : ∀ (psi1 psi2 : Pattern) (n m : nat),
n < m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi2^[svar:n↦psi1]^[svar:m↦psi2] =
phi2^[svar:S m↦psi2]^[svar:n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0
patt_app phi1^[svar:n0↦psi1]^[svar:m0↦psi2]
phi2^[svar:n0↦psi1]^[svar:m0↦psi2] =
patt_app phi1^[svar:S m0↦psi2]^[svar:n0↦psi1]
phi2^[svar:S m0↦psi2]^[svar:n0↦psi1]
rewrite -> IHphi1, -> IHphi2; auto .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (psi1 psi2 : Pattern) (n m : nat),
n < m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi1^[svar:n↦psi1]^[svar:m↦psi2] =
phi1^[svar:S m↦psi2]^[svar:n↦psi1]IHphi2 : ∀ (psi1 psi2 : Pattern) (n m : nat),
n < m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi2^[svar:n↦psi1]^[svar:m↦psi2] =
phi2^[svar:S m↦psi2]^[svar:n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0
patt_imp phi1^[svar:n0↦psi1]^[svar:m0↦psi2]
phi2^[svar:n0↦psi1]^[svar:m0↦psi2] =
patt_imp phi1^[svar:S m0↦psi2]^[svar:n0↦psi1]
phi2^[svar:S m0↦psi2]^[svar:n0↦psi1]
rewrite -> IHphi1, -> IHphi2; auto .
- Σ : Signature phi : Pattern IHphi : ∀ (psi1 psi2 : Pattern) (n m : nat),
n < m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi^[svar:n↦psi1]^[svar:m↦psi2] =
phi^[svar:S m↦psi2]^[svar:n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0
patt_exists phi^[svar:n0↦psi1]^[svar:m0↦psi2] =
patt_exists phi^[svar:S m0↦psi2]^[svar:n0↦psi1]
rewrite -> IHphi; auto .
- Σ : Signature phi : Pattern IHphi : ∀ (psi1 psi2 : Pattern) (n m : nat),
n < m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi^[svar:n↦psi1]^[svar:m↦psi2] =
phi^[svar:S m↦psi2]^[svar:n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0
patt_mu phi^[svar:S n0↦psi1]^[svar:S m0↦psi2] =
patt_mu phi^[svar:S (S m0)↦psi2]^[svar:S n0↦psi1]
rewrite -> IHphi; auto .Σ : Signature phi : Pattern IHphi : ∀ (psi1 psi2 : Pattern) (n m : nat),
n < m
→ well_formed_closed_mu_aux psi1 0
→ well_formed_closed_mu_aux psi2 0
→ phi^[svar:n↦psi1]^[svar:m↦psi2] =
phi^[svar:S m↦psi2]^[svar:n↦psi1]psi1, psi2 : Pattern n0, m0 : nat NEQ : n0 < m0 Hwf1 : well_formed_closed_mu_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0
S n0 < S m0
lia .
Qed .
Corollary evar_open_comm_higher :
forall n m ,
n < m
->
forall x y phi ,
phi^{evar : m ↦ y}^{evar : n ↦ x} = phi^{evar : n ↦ x}^{evar : pred m ↦ y}.Σ : Signature
∀ n m : nat,
n < m
→ ∀ (x y : evar ) (phi : Pattern),
phi^{evar :m↦y}^{evar :n↦x} =
phi^{evar :n↦x}^{evar :Init.Nat.pred m↦y}
Proof .Σ : Signature
∀ n m : nat,
n < m
→ ∀ (x y : evar ) (phi : Pattern),
phi^{evar :m↦y}^{evar :n↦x} =
phi^{evar :n↦x}^{evar :Init.Nat.pred m↦y}
intros n m Hneqnm x y phi.Σ : Signature n, m : nat Hneqnm : n < m x, y : evar phi : Pattern
phi^{evar :m↦y}^{evar :n↦x} =
phi^{evar :n↦x}^{evar :Init.Nat.pred m↦y}
apply bevar_subst_comm_higher; auto .
Qed .
Corollary evar_open_comm_lower :
forall n m ,
n > m
->
forall x y phi ,
phi^{evar : m ↦ y}^{evar : n ↦ x} = phi^{evar : S n ↦ x}^{evar : m ↦ y}.Σ : Signature
∀ n m : nat,
n > m
→ ∀ (x y : evar ) (phi : Pattern),
phi^{evar :m↦y}^{evar :n↦x} =
phi^{evar :S n↦x}^{evar :m↦y}
Proof .Σ : Signature
∀ n m : nat,
n > m
→ ∀ (x y : evar ) (phi : Pattern),
phi^{evar :m↦y}^{evar :n↦x} =
phi^{evar :S n↦x}^{evar :m↦y}
intros n m Hneqnm x y phi.Σ : Signature n, m : nat Hneqnm : n > m x, y : evar phi : Pattern
phi^{evar :m↦y}^{evar :n↦x} =
phi^{evar :S n↦x}^{evar :m↦y}
apply bevar_subst_comm_lower; auto .
Qed .
Corollary svar_open_comm_higher :
forall n m ,
n < m
->
forall X Y phi ,
phi^{svar: m ↦ Y}^{svar: n ↦ X} = phi^{svar: n ↦ X}^{svar: pred m ↦ Y} .Σ : Signature
∀ n m : nat,
n < m
→ ∀ (X Y : svar) (phi : Pattern),
phi^{svar:m↦Y}^{svar:n↦X} =
phi^{svar:n↦X}^{svar:Init.Nat.pred m↦Y}
Proof .Σ : Signature
∀ n m : nat,
n < m
→ ∀ (X Y : svar) (phi : Pattern),
phi^{svar:m↦Y}^{svar:n↦X} =
phi^{svar:n↦X}^{svar:Init.Nat.pred m↦Y}
intros n m Hneqnm x y phi.Σ : Signature n, m : nat Hneqnm : n < m x, y : svar phi : Pattern
phi^{svar:m↦y}^{svar:n↦x} =
phi^{svar:n↦x}^{svar:Init.Nat.pred m↦y}
apply bsvar_subst_comm_higher; auto .
Qed .
Corollary svar_open_comm_lower :
forall n m ,
n > m
->
forall X Y phi ,
phi^{svar: m ↦ Y} ^{svar: n ↦ X} = phi^{svar: S n ↦ X} ^{svar: m ↦ Y}.Σ : Signature
∀ n m : nat,
n > m
→ ∀ (X Y : svar) (phi : Pattern),
phi^{svar:m↦Y}^{svar:n↦X} =
phi^{svar:S n↦X}^{svar:m↦Y}
Proof .Σ : Signature
∀ n m : nat,
n > m
→ ∀ (X Y : svar) (phi : Pattern),
phi^{svar:m↦Y}^{svar:n↦X} =
phi^{svar:S n↦X}^{svar:m↦Y}
intros n m Hneqnm x y phi.Σ : Signature n, m : nat Hneqnm : n > m x, y : svar phi : Pattern
phi^{svar:m↦y}^{svar:n↦x} =
phi^{svar:S n↦x}^{svar:m↦y}
apply bsvar_subst_comm_lower; auto .
Qed .
Lemma bevar_subst_bsvar_subst phi psi1 psi2 dbi1 dbi2
: well_formed_closed psi1 -> well_formed_closed psi2 ->
(phi^[svar: dbi1 ↦ psi1])^[evar : dbi2 ↦ psi2] =
(phi^[evar : dbi2 ↦ psi2])^[svar: dbi1 ↦ psi1].Σ : Signature phi, psi1, psi2 : Pattern dbi1, dbi2 : db_index
well_formed_closed psi1
→ well_formed_closed psi2
→ phi^[svar:dbi1↦psi1]^[evar :dbi2↦psi2] =
phi^[evar :dbi2↦psi2]^[svar:dbi1↦psi1]
Proof .Σ : Signature phi, psi1, psi2 : Pattern dbi1, dbi2 : db_index
well_formed_closed psi1
→ well_formed_closed psi2
→ phi^[svar:dbi1↦psi1]^[evar :dbi2↦psi2] =
phi^[evar :dbi2↦psi2]^[svar:dbi1↦psi1]
generalize dependent dbi1.Σ : Signature phi, psi1, psi2 : Pattern dbi2 : db_index
∀ dbi1 : db_index,
well_formed_closed psi1
→ well_formed_closed psi2
→ phi^[svar:dbi1↦psi1]^[evar :dbi2↦psi2] =
phi^[evar :dbi2↦psi2]^[svar:dbi1↦psi1]
generalize dependent dbi2.Σ : Signature phi, psi1, psi2 : Pattern
∀ dbi2 dbi1 : db_index,
well_formed_closed psi1
→ well_formed_closed psi2
→ phi^[svar:dbi1↦psi1]^[evar :dbi2↦psi2] =
phi^[evar :dbi2↦psi2]^[svar:dbi1↦psi1]
induction phi; intros dbi1 dbi2 Hwf1 Hwf2; simpl ; auto .Σ : Signature n : db_index psi1, psi2 : Pattern dbi1, dbi2 : db_index Hwf1 : well_formed_closed psi1 Hwf2 : well_formed_closed psi2
match compare_nat n dbi1 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi2
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end =
match compare_nat n dbi1 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi2
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end ^[svar:dbi2↦psi1]
* Σ : Signature n : db_index psi1, psi2 : Pattern dbi1, dbi2 : db_index Hwf1 : well_formed_closed psi1 Hwf2 : well_formed_closed psi2
match compare_nat n dbi1 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi2
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end =
match compare_nat n dbi1 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi2
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end ^[svar:dbi2↦psi1]
break_match_goal; auto . Σ : Signature n : db_index psi1, psi2 : Pattern dbi1, dbi2 : db_index Hwf1 : well_formed_closed psi1 Hwf2 : well_formed_closed psi2 e : n = dbi1 Heqc : compare_nat n dbi1 = Nat_equal n dbi1 e
psi2 = psi2^[svar:dbi2↦psi1]
erewrite well_formed_bsvar_subst; auto .Σ : Signature n : db_index psi1, psi2 : Pattern dbi1, dbi2 : db_index Hwf1 : well_formed_closed psi1 Hwf2 : well_formed_closed psi2 e : n = dbi1 Heqc : compare_nat n dbi1 = Nat_equal n dbi1 e
well_formed_closed_mu_aux psi2 dbi2
unfold well_formed_closed in *.Σ : Signature n : db_index psi1, psi2 : Pattern dbi1, dbi2 : db_index Hwf1 : well_formed_closed_mu_aux psi1 0 &&
well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0 &&
well_formed_closed_ex_aux psi2 0 e : n = dbi1 Heqc : compare_nat n dbi1 = Nat_equal n dbi1 e
well_formed_closed_mu_aux psi2 dbi2
destruct_and!. Σ : Signature n : db_index psi1, psi2 : Pattern dbi1, dbi2 : db_index H1 : well_formed_closed_mu_aux psi1 0 = true H2 : well_formed_closed_ex_aux psi1 0 = true H : well_formed_closed_mu_aux psi2 0 = true H0 : well_formed_closed_ex_aux psi2 0 = true e : n = dbi1 Heqc : compare_nat n dbi1 = Nat_equal n dbi1 e
well_formed_closed_mu_aux psi2 dbi2
eapply well_formed_closed_mu_aux_ind.Σ : Signature n : db_index psi1, psi2 : Pattern dbi1, dbi2 : db_index H1 : well_formed_closed_mu_aux psi1 0 = true H2 : well_formed_closed_ex_aux psi1 0 = true H : well_formed_closed_mu_aux psi2 0 = true H0 : well_formed_closed_ex_aux psi2 0 = true e : n = dbi1 Heqc : compare_nat n dbi1 = Nat_equal n dbi1 e
?ind_svar1 ≤ dbi2
2 : eassumption .Σ : Signature n : db_index psi1, psi2 : Pattern dbi1, dbi2 : db_index H1 : well_formed_closed_mu_aux psi1 0 = true H2 : well_formed_closed_ex_aux psi1 0 = true H : well_formed_closed_mu_aux psi2 0 = true H0 : well_formed_closed_ex_aux psi2 0 = true e : n = dbi1 Heqc : compare_nat n dbi1 = Nat_equal n dbi1 e
0 ≤ dbi2
lia .
* Σ : Signature n : db_index psi1, psi2 : Pattern dbi1, dbi2 : db_index Hwf1 : well_formed_closed psi1 Hwf2 : well_formed_closed psi2
match compare_nat n dbi2 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi1
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end ^[evar :dbi1↦psi2] =
match compare_nat n dbi2 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi1
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end
break_match_goal; auto . Σ : Signature n : db_index psi1, psi2 : Pattern dbi1, dbi2 : db_index Hwf1 : well_formed_closed psi1 Hwf2 : well_formed_closed psi2 e : n = dbi2 Heqc : compare_nat n dbi2 = Nat_equal n dbi2 e
psi1^[evar :dbi1↦psi2] = psi1
erewrite well_formed_bevar_subst; auto .Σ : Signature n : db_index psi1, psi2 : Pattern dbi1, dbi2 : db_index Hwf1 : well_formed_closed psi1 Hwf2 : well_formed_closed psi2 e : n = dbi2 Heqc : compare_nat n dbi2 = Nat_equal n dbi2 e
well_formed_closed_ex_aux psi1 dbi1
unfold well_formed_closed in *.Σ : Signature n : db_index psi1, psi2 : Pattern dbi1, dbi2 : db_index Hwf1 : well_formed_closed_mu_aux psi1 0 &&
well_formed_closed_ex_aux psi1 0 Hwf2 : well_formed_closed_mu_aux psi2 0 &&
well_formed_closed_ex_aux psi2 0 e : n = dbi2 Heqc : compare_nat n dbi2 = Nat_equal n dbi2 e
well_formed_closed_ex_aux psi1 dbi1
destruct_and!. Σ : Signature n : db_index psi1, psi2 : Pattern dbi1, dbi2 : db_index H1 : well_formed_closed_mu_aux psi1 0 = true H2 : well_formed_closed_ex_aux psi1 0 = true H : well_formed_closed_mu_aux psi2 0 = true H0 : well_formed_closed_ex_aux psi2 0 = true e : n = dbi2 Heqc : compare_nat n dbi2 = Nat_equal n dbi2 e
well_formed_closed_ex_aux psi1 dbi1
eapply well_formed_closed_ex_aux_ind.Σ : Signature n : db_index psi1, psi2 : Pattern dbi1, dbi2 : db_index H1 : well_formed_closed_mu_aux psi1 0 = true H2 : well_formed_closed_ex_aux psi1 0 = true H : well_formed_closed_mu_aux psi2 0 = true H0 : well_formed_closed_ex_aux psi2 0 = true e : n = dbi2 Heqc : compare_nat n dbi2 = Nat_equal n dbi2 e
?ind_evar1 ≤ dbi1
2 : eassumption .Σ : Signature n : db_index psi1, psi2 : Pattern dbi1, dbi2 : db_index H1 : well_formed_closed_mu_aux psi1 0 = true H2 : well_formed_closed_ex_aux psi1 0 = true H : well_formed_closed_mu_aux psi2 0 = true H0 : well_formed_closed_ex_aux psi2 0 = true e : n = dbi2 Heqc : compare_nat n dbi2 = Nat_equal n dbi2 e
0 ≤ dbi1
lia .
* Σ : Signature phi1, phi2, psi1, psi2 : Pattern IHphi1 : ∀ dbi2 dbi1 : db_index,
well_formed_closed psi1
→ well_formed_closed psi2
→ phi1^[svar:dbi1↦psi1]^[evar :dbi2↦psi2] =
phi1^[evar :dbi2↦psi2]^[svar:dbi1↦psi1]IHphi2 : ∀ dbi2 dbi1 : db_index,
well_formed_closed psi1
→ well_formed_closed psi2
→ phi2^[svar:dbi1↦psi1]^[evar :dbi2↦psi2] =
phi2^[evar :dbi2↦psi2]^[svar:dbi1↦psi1]dbi1, dbi2 : db_index Hwf1 : well_formed_closed psi1 Hwf2 : well_formed_closed psi2
patt_app phi1^[svar:dbi2↦psi1]^[evar :dbi1↦psi2]
phi2^[svar:dbi2↦psi1]^[evar :dbi1↦psi2] =
patt_app phi1^[evar :dbi1↦psi2]^[svar:dbi2↦psi1]
phi2^[evar :dbi1↦psi2]^[svar:dbi2↦psi1]
simpl .Σ : Signature phi1, phi2, psi1, psi2 : Pattern IHphi1 : ∀ dbi2 dbi1 : db_index,
well_formed_closed psi1
→ well_formed_closed psi2
→ phi1^[svar:dbi1↦psi1]^[evar :dbi2↦psi2] =
phi1^[evar :dbi2↦psi2]^[svar:dbi1↦psi1]IHphi2 : ∀ dbi2 dbi1 : db_index,
well_formed_closed psi1
→ well_formed_closed psi2
→ phi2^[svar:dbi1↦psi1]^[evar :dbi2↦psi2] =
phi2^[evar :dbi2↦psi2]^[svar:dbi1↦psi1]dbi1, dbi2 : db_index Hwf1 : well_formed_closed psi1 Hwf2 : well_formed_closed psi2
patt_app phi1^[svar:dbi2↦psi1]^[evar :dbi1↦psi2]
phi2^[svar:dbi2↦psi1]^[evar :dbi1↦psi2] =
patt_app phi1^[evar :dbi1↦psi2]^[svar:dbi2↦psi1]
phi2^[evar :dbi1↦psi2]^[svar:dbi2↦psi1]
rewrite -> IHphi1, -> IHphi2; auto .
* Σ : Signature phi1, phi2, psi1, psi2 : Pattern IHphi1 : ∀ dbi2 dbi1 : db_index,
well_formed_closed psi1
→ well_formed_closed psi2
→ phi1^[svar:dbi1↦psi1]^[evar :dbi2↦psi2] =
phi1^[evar :dbi2↦psi2]^[svar:dbi1↦psi1]IHphi2 : ∀ dbi2 dbi1 : db_index,
well_formed_closed psi1
→ well_formed_closed psi2
→ phi2^[svar:dbi1↦psi1]^[evar :dbi2↦psi2] =
phi2^[evar :dbi2↦psi2]^[svar:dbi1↦psi1]dbi1, dbi2 : db_index Hwf1 : well_formed_closed psi1 Hwf2 : well_formed_closed psi2
patt_imp phi1^[svar:dbi2↦psi1]^[evar :dbi1↦psi2]
phi2^[svar:dbi2↦psi1]^[evar :dbi1↦psi2] =
patt_imp phi1^[evar :dbi1↦psi2]^[svar:dbi2↦psi1]
phi2^[evar :dbi1↦psi2]^[svar:dbi2↦psi1]
simpl .Σ : Signature phi1, phi2, psi1, psi2 : Pattern IHphi1 : ∀ dbi2 dbi1 : db_index,
well_formed_closed psi1
→ well_formed_closed psi2
→ phi1^[svar:dbi1↦psi1]^[evar :dbi2↦psi2] =
phi1^[evar :dbi2↦psi2]^[svar:dbi1↦psi1]IHphi2 : ∀ dbi2 dbi1 : db_index,
well_formed_closed psi1
→ well_formed_closed psi2
→ phi2^[svar:dbi1↦psi1]^[evar :dbi2↦psi2] =
phi2^[evar :dbi2↦psi2]^[svar:dbi1↦psi1]dbi1, dbi2 : db_index Hwf1 : well_formed_closed psi1 Hwf2 : well_formed_closed psi2
patt_imp phi1^[svar:dbi2↦psi1]^[evar :dbi1↦psi2]
phi2^[svar:dbi2↦psi1]^[evar :dbi1↦psi2] =
patt_imp phi1^[evar :dbi1↦psi2]^[svar:dbi2↦psi1]
phi2^[evar :dbi1↦psi2]^[svar:dbi2↦psi1]
rewrite -> IHphi1, -> IHphi2; auto .
* Σ : Signature phi, psi1, psi2 : Pattern IHphi : ∀ dbi2 dbi1 : db_index,
well_formed_closed psi1
→ well_formed_closed psi2
→ phi^[svar:dbi1↦psi1]^[evar :dbi2↦psi2] =
phi^[evar :dbi2↦psi2]^[svar:dbi1↦psi1]dbi1, dbi2 : db_index Hwf1 : well_formed_closed psi1 Hwf2 : well_formed_closed psi2
patt_exists phi^[svar:dbi2↦psi1]^[evar :S dbi1↦psi2] =
patt_exists phi^[evar :S dbi1↦psi2]^[svar:dbi2↦psi1]
simpl .Σ : Signature phi, psi1, psi2 : Pattern IHphi : ∀ dbi2 dbi1 : db_index,
well_formed_closed psi1
→ well_formed_closed psi2
→ phi^[svar:dbi1↦psi1]^[evar :dbi2↦psi2] =
phi^[evar :dbi2↦psi2]^[svar:dbi1↦psi1]dbi1, dbi2 : db_index Hwf1 : well_formed_closed psi1 Hwf2 : well_formed_closed psi2
patt_exists phi^[svar:dbi2↦psi1]^[evar :S dbi1↦psi2] =
patt_exists phi^[evar :S dbi1↦psi2]^[svar:dbi2↦psi1]
rewrite IHphi; auto .
* Σ : Signature phi, psi1, psi2 : Pattern IHphi : ∀ dbi2 dbi1 : db_index,
well_formed_closed psi1
→ well_formed_closed psi2
→ phi^[svar:dbi1↦psi1]^[evar :dbi2↦psi2] =
phi^[evar :dbi2↦psi2]^[svar:dbi1↦psi1]dbi1, dbi2 : db_index Hwf1 : well_formed_closed psi1 Hwf2 : well_formed_closed psi2
patt_mu phi^[svar:S dbi2↦psi1]^[evar :dbi1↦psi2] =
patt_mu phi^[evar :dbi1↦psi2]^[svar:S dbi2↦psi1]
simpl .Σ : Signature phi, psi1, psi2 : Pattern IHphi : ∀ dbi2 dbi1 : db_index,
well_formed_closed psi1
→ well_formed_closed psi2
→ phi^[svar:dbi1↦psi1]^[evar :dbi2↦psi2] =
phi^[evar :dbi2↦psi2]^[svar:dbi1↦psi1]dbi1, dbi2 : db_index Hwf1 : well_formed_closed psi1 Hwf2 : well_formed_closed psi2
patt_mu phi^[svar:S dbi2↦psi1]^[evar :dbi1↦psi2] =
patt_mu phi^[evar :dbi1↦psi2]^[svar:S dbi2↦psi1]
rewrite IHphi; auto .
Qed .
Corollary svar_open_evar_open_comm
: forall (phi : Pattern) (dbi1 : db_index)(x : evar )(dbi2 : db_index)(X : svar),
phi^{svar: dbi2 ↦ X}^{evar : dbi1 ↦ x} = phi^{evar : dbi1 ↦ x}^{svar: dbi2 ↦ X} .Σ : Signature
∀ (phi : Pattern) (dbi1 : db_index) (x : evar ) (dbi2 : db_index)
(X : svar),
phi^{svar:dbi2↦X}^{evar :dbi1↦x} =
phi^{evar :dbi1↦x}^{svar:dbi2↦X}
Proof .Σ : Signature
∀ (phi : Pattern) (dbi1 : db_index) (x : evar ) (dbi2 : db_index)
(X : svar),
phi^{svar:dbi2↦X}^{evar :dbi1↦x} =
phi^{evar :dbi1↦x}^{svar:dbi2↦X}
intros phi dbi1 x dbi2 X.Σ : Signature phi : Pattern dbi1 : db_index x : evar dbi2 : db_index X : svar
phi^{svar:dbi2↦X}^{evar :dbi1↦x} =
phi^{evar :dbi1↦x}^{svar:dbi2↦X}
apply bevar_subst_bsvar_subst; auto .
Qed .
Lemma free_svars_evar_open : forall (ϕ : Pattern) (dbi :db_index) (x : evar ),
free_svars ϕ^{evar : dbi ↦ x} = free_svars ϕ.Σ : Signature
∀ (ϕ : Pattern) (dbi : db_index) (x : evar ),
free_svars ϕ^{evar :dbi↦x} = free_svars ϕ
Proof .Σ : Signature
∀ (ϕ : Pattern) (dbi : db_index) (x : evar ),
free_svars ϕ^{evar :dbi↦x} = free_svars ϕ
unfold evar_open.Σ : Signature
∀ (ϕ : Pattern) (dbi : db_index) (x : evar ),
free_svars ϕ^[evar :dbi↦patt_free_evar x] =
free_svars ϕ
induction ϕ; intros dbi x'; simpl ; try reflexivity .Σ : Signature n, dbi : db_index x' : evar
free_svars
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x'
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = ∅
* Σ : Signature n, dbi : db_index x' : evar
free_svars
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x'
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = ∅
case_match; reflexivity .
* Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (dbi : db_index) (x : evar ),
free_svars ϕ1^[evar :dbi↦patt_free_evar x] =
free_svars ϕ1IHϕ2 : ∀ (dbi : db_index) (x : evar ),
free_svars ϕ2^[evar :dbi↦patt_free_evar x] =
free_svars ϕ2dbi : db_index x' : evar
free_svars ϕ1^[evar :dbi↦patt_free_evar x']
∪ free_svars ϕ2^[evar :dbi↦patt_free_evar x'] =
free_svars ϕ1 ∪ free_svars ϕ2
rewrite -> IHϕ1.Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (dbi : db_index) (x : evar ),
free_svars ϕ1^[evar :dbi↦patt_free_evar x] =
free_svars ϕ1IHϕ2 : ∀ (dbi : db_index) (x : evar ),
free_svars ϕ2^[evar :dbi↦patt_free_evar x] =
free_svars ϕ2dbi : db_index x' : evar
free_svars ϕ1
∪ free_svars ϕ2^[evar :dbi↦patt_free_evar x'] =
free_svars ϕ1 ∪ free_svars ϕ2
rewrite -> IHϕ2.Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (dbi : db_index) (x : evar ),
free_svars ϕ1^[evar :dbi↦patt_free_evar x] =
free_svars ϕ1IHϕ2 : ∀ (dbi : db_index) (x : evar ),
free_svars ϕ2^[evar :dbi↦patt_free_evar x] =
free_svars ϕ2dbi : db_index x' : evar
free_svars ϕ1 ∪ free_svars ϕ2 =
free_svars ϕ1 ∪ free_svars ϕ2
reflexivity .
* Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (dbi : db_index) (x : evar ),
free_svars ϕ1^[evar :dbi↦patt_free_evar x] =
free_svars ϕ1IHϕ2 : ∀ (dbi : db_index) (x : evar ),
free_svars ϕ2^[evar :dbi↦patt_free_evar x] =
free_svars ϕ2dbi : db_index x' : evar
free_svars ϕ1^[evar :dbi↦patt_free_evar x']
∪ free_svars ϕ2^[evar :dbi↦patt_free_evar x'] =
free_svars ϕ1 ∪ free_svars ϕ2
rewrite -> IHϕ1.Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (dbi : db_index) (x : evar ),
free_svars ϕ1^[evar :dbi↦patt_free_evar x] =
free_svars ϕ1IHϕ2 : ∀ (dbi : db_index) (x : evar ),
free_svars ϕ2^[evar :dbi↦patt_free_evar x] =
free_svars ϕ2dbi : db_index x' : evar
free_svars ϕ1
∪ free_svars ϕ2^[evar :dbi↦patt_free_evar x'] =
free_svars ϕ1 ∪ free_svars ϕ2
rewrite -> IHϕ2.Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (dbi : db_index) (x : evar ),
free_svars ϕ1^[evar :dbi↦patt_free_evar x] =
free_svars ϕ1IHϕ2 : ∀ (dbi : db_index) (x : evar ),
free_svars ϕ2^[evar :dbi↦patt_free_evar x] =
free_svars ϕ2dbi : db_index x' : evar
free_svars ϕ1 ∪ free_svars ϕ2 =
free_svars ϕ1 ∪ free_svars ϕ2
reflexivity .
* Σ : Signature ϕ : Pattern IHϕ : ∀ (dbi : db_index) (x : evar ),
free_svars ϕ^[evar :dbi↦patt_free_evar x] = free_svars ϕdbi : db_index x' : evar
free_svars ϕ^[evar :S dbi↦patt_free_evar x'] =
free_svars ϕ
rewrite -> IHϕ.Σ : Signature ϕ : Pattern IHϕ : ∀ (dbi : db_index) (x : evar ),
free_svars ϕ^[evar :dbi↦patt_free_evar x] = free_svars ϕdbi : db_index x' : evar
free_svars ϕ = free_svars ϕ
reflexivity .
* Σ : Signature ϕ : Pattern IHϕ : ∀ (dbi : db_index) (x : evar ),
free_svars ϕ^[evar :dbi↦patt_free_evar x] = free_svars ϕdbi : db_index x' : evar
free_svars ϕ^[evar :dbi↦patt_free_evar x'] =
free_svars ϕ
rewrite -> IHϕ.Σ : Signature ϕ : Pattern IHϕ : ∀ (dbi : db_index) (x : evar ),
free_svars ϕ^[evar :dbi↦patt_free_evar x] = free_svars ϕdbi : db_index x' : evar
free_svars ϕ = free_svars ϕ
reflexivity .
Qed .
Lemma positive_negative_occurrence_db_named :
forall (phi : Pattern) (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi ->
svar_has_positive_occurrence X phi = false ->
svar_has_positive_occurrence X (phi^{svar: dbi ↦ X}) = false)
/\ (no_negative_occurrence_db_b dbi phi ->
svar_has_negative_occurrence X phi = false ->
svar_has_negative_occurrence X (phi^{svar: dbi ↦ X}) = false).Σ : Signature
∀ (phi : Pattern) (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi
→ svar_has_positive_occurrence X phi = false
→ svar_has_positive_occurrence X phi^{svar:dbi↦X} =
false)
∧ (no_negative_occurrence_db_b dbi phi
→ svar_has_negative_occurrence X phi = false
→ svar_has_negative_occurrence X
phi^{svar:dbi↦X} = false)
Proof .Σ : Signature
∀ (phi : Pattern) (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi
→ svar_has_positive_occurrence X phi = false
→ svar_has_positive_occurrence X phi^{svar:dbi↦X} =
false)
∧ (no_negative_occurrence_db_b dbi phi
→ svar_has_negative_occurrence X phi = false
→ svar_has_negative_occurrence X
phi^{svar:dbi↦X} = false)
unfold svar_open.Σ : Signature
∀ (phi : Pattern) (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi
→ svar_has_positive_occurrence X phi = false
→ svar_has_positive_occurrence X
phi^[svar:dbi↦patt_free_svar X] = false)
∧ (no_negative_occurrence_db_b dbi phi
→ svar_has_negative_occurrence X phi = false
→ svar_has_negative_occurrence X
phi^[svar:dbi↦patt_free_svar X] = false)
induction phi; intros dbi X; split ; simpl ; try firstorder ; cbn in *.Σ : Signature n, dbi : db_index X : svar H : if decide (n = dbi) then false else trueH0 : false = false
svar_has_positive_occurrence X
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar X
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end = false
* Σ : Signature n, dbi : db_index X : svar H : if decide (n = dbi) then false else trueH0 : false = false
svar_has_positive_occurrence X
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar X
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end = false
do 2 case_match; auto ; congruence .
* Σ : Signature n, dbi : db_index X : svar H : true H0 : false = false
svar_has_negative_occurrence X
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar X
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end = false
case_match; auto ; congruence .
* Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi1
→ svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi1
→ svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦
patt_free_svar X] = false)IHphi2 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi2
→ svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi2
→ svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦
patt_free_svar X] = false)dbi : db_index X : svar H : no_positive_occurrence_db_b dbi phi1 &&
no_positive_occurrence_db_b dbi phi2 H0 : svar_has_positive_occurrence X phi1
|| svar_has_positive_occurrence X phi2 = false
svar_has_positive_occurrence X
phi1^[svar:dbi↦patt_free_svar X]
|| svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] = false
destruct_and!. Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi1
→ svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi1
→ svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦
patt_free_svar X] = false)IHphi2 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi2
→ svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi2
→ svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦
patt_free_svar X] = false)dbi : db_index X : svar H1 : no_positive_occurrence_db_b dbi phi1 = true H2 : no_positive_occurrence_db_b dbi phi2 = true H0 : svar_has_positive_occurrence X phi1
|| svar_has_positive_occurrence X phi2 = false
svar_has_positive_occurrence X
phi1^[svar:dbi↦patt_free_svar X]
|| svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] = false
apply orb_false_iff in H0 as [H01 H02].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi1
→ svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi1
→ svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦
patt_free_svar X] = false)IHphi2 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi2
→ svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi2
→ svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦
patt_free_svar X] = false)dbi : db_index X : svar H1 : no_positive_occurrence_db_b dbi phi1 = true H2 : no_positive_occurrence_db_b dbi phi2 = true H01 : svar_has_positive_occurrence X phi1 = false H02 : svar_has_positive_occurrence X phi2 = false
svar_has_positive_occurrence X
phi1^[svar:dbi↦patt_free_svar X]
|| svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] = false
erewrite -> (proj1 (IHphi1 _ _)), -> (proj1 (IHphi2 _ _)); auto .
* Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi1
→ svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi1
→ svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦
patt_free_svar X] = false)IHphi2 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi2
→ svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi2
→ svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦
patt_free_svar X] = false)dbi : db_index X : svar H : no_negative_occurrence_db_b dbi phi1 &&
no_negative_occurrence_db_b dbi phi2 H0 : svar_has_negative_occurrence X phi1
|| svar_has_negative_occurrence X phi2 = false
svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar X]
|| svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar X] = false
destruct_and!. Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi1
→ svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi1
→ svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦
patt_free_svar X] = false)IHphi2 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi2
→ svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi2
→ svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦
patt_free_svar X] = false)dbi : db_index X : svar H1 : no_negative_occurrence_db_b dbi phi1 = true H2 : no_negative_occurrence_db_b dbi phi2 = true H0 : svar_has_negative_occurrence X phi1
|| svar_has_negative_occurrence X phi2 = false
svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar X]
|| svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar X] = false
apply orb_false_iff in H0 as [H01 H02].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi1
→ svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi1
→ svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦
patt_free_svar X] = false)IHphi2 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi2
→ svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi2
→ svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦
patt_free_svar X] = false)dbi : db_index X : svar H1 : no_negative_occurrence_db_b dbi phi1 = true H2 : no_negative_occurrence_db_b dbi phi2 = true H01 : svar_has_negative_occurrence X phi1 = false H02 : svar_has_negative_occurrence X phi2 = false
svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar X]
|| svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar X] = false
erewrite -> (proj2 (IHphi1 _ _)), -> (proj2 (IHphi2 _ _)); auto .
* Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi1
→ svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi1
→ svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦
patt_free_svar X] = false)IHphi2 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi2
→ svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi2
→ svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦
patt_free_svar X] = false)dbi : db_index X : svar H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi phi1 &&
no_positive_occurrence_db_b dbi phi2 H0 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X phi1
|| svar_has_positive_occurrence X phi2 = false
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X
phi1^[svar:dbi↦patt_free_svar X]
|| svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] = false
destruct_and!. Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi1
→ svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi1
→ svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦
patt_free_svar X] = false)IHphi2 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi2
→ svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi2
→ svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦
patt_free_svar X] = false)dbi : db_index X : svar H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi phi1 = true H2 : no_positive_occurrence_db_b dbi phi2 = true H0 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X phi1
|| svar_has_positive_occurrence X phi2 = false
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X
phi1^[svar:dbi↦patt_free_svar X]
|| svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] = false
apply orb_false_iff in H0 as [H01 H02].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi1
→ svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi1
→ svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦
patt_free_svar X] = false)IHphi2 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi2
→ svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi2
→ svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦
patt_free_svar X] = false)dbi : db_index X : svar H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi phi1 = true H2 : no_positive_occurrence_db_b dbi phi2 = true H01 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X phi1 = false H02 : svar_has_positive_occurrence X phi2 = false
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X
phi1^[svar:dbi↦patt_free_svar X]
|| svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] = false
erewrite -> (proj2 (IHphi1 _ _)), -> (proj1 (IHphi2 _ _)); auto .
* Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi1
→ svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi1
→ svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦
patt_free_svar X] = false)IHphi2 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi2
→ svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi2
→ svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦
patt_free_svar X] = false)dbi : db_index X : svar H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi phi1 &&
no_negative_occurrence_db_b dbi phi2 H0 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X phi1
|| svar_has_negative_occurrence X phi2 = false
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X
phi1^[svar:dbi↦patt_free_svar X]
|| svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar X] = false
destruct_and!. Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi1
→ svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi1
→ svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦
patt_free_svar X] = false)IHphi2 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi2
→ svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi2
→ svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦
patt_free_svar X] = false)dbi : db_index X : svar H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi phi1 = true H2 : no_negative_occurrence_db_b dbi phi2 = true H0 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X phi1
|| svar_has_negative_occurrence X phi2 = false
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X
phi1^[svar:dbi↦patt_free_svar X]
|| svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar X] = false
apply orb_false_iff in H0 as [H01 H02].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi1
→ svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi1
→ svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦
patt_free_svar X] = false)IHphi2 : ∀ (dbi : db_index) (X : svar),
(no_positive_occurrence_db_b dbi phi2
→ svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar X] =
false)
∧ (no_negative_occurrence_db_b dbi phi2
→ svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦
patt_free_svar X] = false)dbi : db_index X : svar H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi phi1 = true H2 : no_negative_occurrence_db_b dbi phi2 = true H01 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X phi1 = false H02 : svar_has_negative_occurrence X phi2 = false
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X
phi1^[svar:dbi↦patt_free_svar X]
|| svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar X] = false
erewrite -> (proj1 (IHphi1 _ _)), -> (proj2 (IHphi2 _ _)); auto .
Qed .
Lemma positive_negative_occurrence_evar_open : forall (ϕ : Pattern) (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X (ϕ^{evar : dbi ↦ x}) = false <-> svar_has_positive_occurrence X ϕ = false)
/\ (svar_has_negative_occurrence X (ϕ^{evar : dbi ↦ x}) = false <-> svar_has_negative_occurrence X ϕ = false).Σ : Signature
∀ (ϕ : Pattern) (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^{evar :dbi↦x} =
false ↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^{evar :dbi↦x} =
false ↔ svar_has_negative_occurrence X ϕ = false)
Proof .Σ : Signature
∀ (ϕ : Pattern) (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^{evar :dbi↦x} =
false ↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^{evar :dbi↦x} =
false ↔ svar_has_negative_occurrence X ϕ = false)
unfold evar_open.Σ : Signature
∀ (ϕ : Pattern) (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X
ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)
induction ϕ; intros dbi X; split ; simpl ; auto ; cbn .Σ : Signature n : db_index dbi : svar X : db_index x : evar
svar_has_positive_occurrence dbi
match compare_nat n X with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = false ↔ false = false
* Σ : Signature n : db_index dbi : svar X : db_index x : evar
svar_has_positive_occurrence dbi
match compare_nat n X with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = false ↔ false = false
case_match; auto ; congruence .
* Σ : Signature n : db_index dbi : svar X : db_index x : evar
svar_has_negative_occurrence dbi
match compare_nat n X with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = false ↔ false = false
case_match; auto ; congruence .
* Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar
svar_has_positive_occurrence dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_positive_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
↔ svar_has_positive_occurrence dbi ϕ1
|| svar_has_positive_occurrence dbi ϕ2 = false
split .Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar
svar_has_positive_occurrence dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_positive_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
→ svar_has_positive_occurrence dbi ϕ1
|| svar_has_positive_occurrence dbi ϕ2 = false
- Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar
svar_has_positive_occurrence dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_positive_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
→ svar_has_positive_occurrence dbi ϕ1
|| svar_has_positive_occurrence dbi ϕ2 = false
intro H.Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar H : svar_has_positive_occurrence dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_positive_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
svar_has_positive_occurrence dbi ϕ1
|| svar_has_positive_occurrence dbi ϕ2 = false
apply orb_false_iff in H as [? ?].Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar H : svar_has_positive_occurrence dbi
ϕ1^[evar :X↦patt_free_evar x] = false H0 : svar_has_positive_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
svar_has_positive_occurrence dbi ϕ1
|| svar_has_positive_occurrence dbi ϕ2 = false
erewrite -> (proj1 (proj1 (IHϕ1 _ _ _))), -> (proj1 (proj1 (IHϕ2 _ _ _))); eauto .
- Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar
svar_has_positive_occurrence dbi ϕ1
|| svar_has_positive_occurrence dbi ϕ2 = false
→ svar_has_positive_occurrence dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_positive_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
intro H.Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar H : svar_has_positive_occurrence dbi ϕ1
|| svar_has_positive_occurrence dbi ϕ2 = false
svar_has_positive_occurrence dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_positive_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
apply orb_false_iff in H as [? ?].Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar H : svar_has_positive_occurrence dbi ϕ1 = false H0 : svar_has_positive_occurrence dbi ϕ2 = false
svar_has_positive_occurrence dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_positive_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
erewrite -> (proj2 (proj1 (IHϕ1 _ _ _))), -> (proj2 (proj1 (IHϕ2 _ _ _))); eauto .
* Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar
svar_has_negative_occurrence dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_negative_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
↔ svar_has_negative_occurrence dbi ϕ1
|| svar_has_negative_occurrence dbi ϕ2 = false
split .Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar
svar_has_negative_occurrence dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_negative_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
→ svar_has_negative_occurrence dbi ϕ1
|| svar_has_negative_occurrence dbi ϕ2 = false
- Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar
svar_has_negative_occurrence dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_negative_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
→ svar_has_negative_occurrence dbi ϕ1
|| svar_has_negative_occurrence dbi ϕ2 = false
intro H.Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar H : svar_has_negative_occurrence dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_negative_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
svar_has_negative_occurrence dbi ϕ1
|| svar_has_negative_occurrence dbi ϕ2 = false
apply orb_false_iff in H as [? ?].Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar H : svar_has_negative_occurrence dbi
ϕ1^[evar :X↦patt_free_evar x] = false H0 : svar_has_negative_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
svar_has_negative_occurrence dbi ϕ1
|| svar_has_negative_occurrence dbi ϕ2 = false
erewrite -> (proj1 (proj2 (IHϕ1 _ _ _))), -> (proj1 (proj2 (IHϕ2 _ _ _))); eauto .
- Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar
svar_has_negative_occurrence dbi ϕ1
|| svar_has_negative_occurrence dbi ϕ2 = false
→ svar_has_negative_occurrence dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_negative_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
intro H.Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar H : svar_has_negative_occurrence dbi ϕ1
|| svar_has_negative_occurrence dbi ϕ2 = false
svar_has_negative_occurrence dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_negative_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
apply orb_false_iff in H as [? ?].Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar H : svar_has_negative_occurrence dbi ϕ1 = false H0 : svar_has_negative_occurrence dbi ϕ2 = false
svar_has_negative_occurrence dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_negative_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
erewrite -> (proj2 (proj2 (IHϕ1 _ _ _))), -> (proj2 (proj2 (IHϕ2 _ _ _))); eauto .
* Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_positive_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
↔ (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) dbi ϕ1
|| svar_has_positive_occurrence dbi ϕ2 = false
split .Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_positive_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
→ (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) dbi ϕ1
|| svar_has_positive_occurrence dbi ϕ2 = false
- Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_positive_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
→ (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) dbi ϕ1
|| svar_has_positive_occurrence dbi ϕ2 = false
intro H.Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_positive_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) dbi ϕ1
|| svar_has_positive_occurrence dbi ϕ2 = false
apply orb_false_iff in H as [? ?].Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) dbi
ϕ1^[evar :X↦patt_free_evar x] = false H0 : svar_has_positive_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) dbi ϕ1
|| svar_has_positive_occurrence dbi ϕ2 = false
erewrite -> (proj1 (proj2 (IHϕ1 _ _ _))), -> (proj1 (proj1 (IHϕ2 _ _ _))); eauto .
- Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) dbi ϕ1
|| svar_has_positive_occurrence dbi ϕ2 = false
→ (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_positive_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
intro H.Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) dbi ϕ1
|| svar_has_positive_occurrence dbi ϕ2 = false
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_positive_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
apply orb_false_iff in H as [? ?].Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) dbi ϕ1 = false H0 : svar_has_positive_occurrence dbi ϕ2 = false
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_positive_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
erewrite -> (proj2 (proj2 (IHϕ1 _ _ _))), -> (proj2 (proj1 (IHϕ2 _ _ _))); eauto .
* Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_negative_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
↔ (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) dbi ϕ1
|| svar_has_negative_occurrence dbi ϕ2 = false
split .Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_negative_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
→ (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) dbi ϕ1
|| svar_has_negative_occurrence dbi ϕ2 = false
- Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_negative_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
→ (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) dbi ϕ1
|| svar_has_negative_occurrence dbi ϕ2 = false
intro H.Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_negative_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) dbi ϕ1
|| svar_has_negative_occurrence dbi ϕ2 = false
apply orb_false_iff in H as [? ?].Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) dbi
ϕ1^[evar :X↦patt_free_evar x] = false H0 : svar_has_negative_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) dbi ϕ1
|| svar_has_negative_occurrence dbi ϕ2 = false
erewrite -> (proj1 (proj1 (IHϕ1 _ _ _))), -> (proj1 (proj2 (IHϕ2 _ _ _))); eauto .
- Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) dbi ϕ1
|| svar_has_negative_occurrence dbi ϕ2 = false
→ (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_negative_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
intro H.Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) dbi ϕ1
|| svar_has_negative_occurrence dbi ϕ2 = false
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_negative_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
apply orb_false_iff in H as [? ?].Σ : Signature ϕ1, ϕ2 : Pattern IHϕ1 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ1 = false)
∧ (svar_has_negative_occurrence X
ϕ1^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ1 =
false)IHϕ2 : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ2 = false)
∧ (svar_has_negative_occurrence X
ϕ2^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ2 =
false)dbi : svar X : db_index x : evar H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) dbi ϕ1 = false H0 : svar_has_negative_occurrence dbi ϕ2 = false
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) dbi
ϕ1^[evar :X↦patt_free_evar x]
|| svar_has_negative_occurrence dbi
ϕ2^[evar :X↦patt_free_evar x] = false
erewrite -> (proj2 (proj1 (IHϕ1 _ _ _))), -> (proj2 (proj2 (IHϕ2 _ _ _))); eauto .
* Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar
svar_has_positive_occurrence dbi
ϕ^[evar :S X↦patt_free_evar x] = false
↔ svar_has_positive_occurrence dbi ϕ = false
split .Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar
svar_has_positive_occurrence dbi
ϕ^[evar :S X↦patt_free_evar x] = false
→ svar_has_positive_occurrence dbi ϕ = false
- Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar
svar_has_positive_occurrence dbi
ϕ^[evar :S X↦patt_free_evar x] = false
→ svar_has_positive_occurrence dbi ϕ = false
intro H.Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar H : svar_has_positive_occurrence dbi
ϕ^[evar :S X↦patt_free_evar x] = false
svar_has_positive_occurrence dbi ϕ = false
erewrite -> (proj1 (proj1 (IHϕ _ _ _))); eauto .
- Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar
svar_has_positive_occurrence dbi ϕ = false
→ svar_has_positive_occurrence dbi
ϕ^[evar :S X↦patt_free_evar x] = false
intro H.Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar H : svar_has_positive_occurrence dbi ϕ = false
svar_has_positive_occurrence dbi
ϕ^[evar :S X↦patt_free_evar x] = false
erewrite -> (proj2 (proj1 (IHϕ _ _ _))); eauto .
* Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar
svar_has_negative_occurrence dbi
ϕ^[evar :S X↦patt_free_evar x] = false
↔ svar_has_negative_occurrence dbi ϕ = false
split .Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar
svar_has_negative_occurrence dbi
ϕ^[evar :S X↦patt_free_evar x] = false
→ svar_has_negative_occurrence dbi ϕ = false
- Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar
svar_has_negative_occurrence dbi
ϕ^[evar :S X↦patt_free_evar x] = false
→ svar_has_negative_occurrence dbi ϕ = false
intro H.Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar H : svar_has_negative_occurrence dbi
ϕ^[evar :S X↦patt_free_evar x] = false
svar_has_negative_occurrence dbi ϕ = false
erewrite -> (proj1 (proj2 (IHϕ _ _ _))); eauto .
- Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar
svar_has_negative_occurrence dbi ϕ = false
→ svar_has_negative_occurrence dbi
ϕ^[evar :S X↦patt_free_evar x] = false
intro H.Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar H : svar_has_negative_occurrence dbi ϕ = false
svar_has_negative_occurrence dbi
ϕ^[evar :S X↦patt_free_evar x] = false
erewrite -> (proj2 (proj2 (IHϕ _ _ _))); eauto .
* Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar
svar_has_positive_occurrence dbi
ϕ^[evar :X↦patt_free_evar x] = false
↔ svar_has_positive_occurrence dbi ϕ = false
split .Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar
svar_has_positive_occurrence dbi
ϕ^[evar :X↦patt_free_evar x] = false
→ svar_has_positive_occurrence dbi ϕ = false
- Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar
svar_has_positive_occurrence dbi
ϕ^[evar :X↦patt_free_evar x] = false
→ svar_has_positive_occurrence dbi ϕ = false
intro H.Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar H : svar_has_positive_occurrence dbi
ϕ^[evar :X↦patt_free_evar x] = false
svar_has_positive_occurrence dbi ϕ = false
erewrite -> (proj1 (proj1 (IHϕ _ _ _))); eauto .
- Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar
svar_has_positive_occurrence dbi ϕ = false
→ svar_has_positive_occurrence dbi
ϕ^[evar :X↦patt_free_evar x] = false
intro H.Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar H : svar_has_positive_occurrence dbi ϕ = false
svar_has_positive_occurrence dbi
ϕ^[evar :X↦patt_free_evar x] = false
erewrite -> (proj2 (proj1 (IHϕ _ _ _))); eauto .
* Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar
svar_has_negative_occurrence dbi
ϕ^[evar :X↦patt_free_evar x] = false
↔ svar_has_negative_occurrence dbi ϕ = false
split .Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar
svar_has_negative_occurrence dbi
ϕ^[evar :X↦patt_free_evar x] = false
→ svar_has_negative_occurrence dbi ϕ = false
- Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar
svar_has_negative_occurrence dbi
ϕ^[evar :X↦patt_free_evar x] = false
→ svar_has_negative_occurrence dbi ϕ = false
intro H.Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar H : svar_has_negative_occurrence dbi
ϕ^[evar :X↦patt_free_evar x] = false
svar_has_negative_occurrence dbi ϕ = false
erewrite -> (proj1 (proj2 (IHϕ _ _ _))); eauto .
- Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar
svar_has_negative_occurrence dbi ϕ = false
→ svar_has_negative_occurrence dbi
ϕ^[evar :X↦patt_free_evar x] = false
intro H.Σ : Signature ϕ : Pattern IHϕ : ∀ (X : svar) (dbi : db_index) (x : evar ),
(svar_has_positive_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_positive_occurrence X ϕ = false)
∧ (svar_has_negative_occurrence X ϕ^[evar :dbi↦patt_free_evar x] = false
↔ svar_has_negative_occurrence X ϕ = false)dbi : svar X : db_index x : evar H : svar_has_negative_occurrence dbi ϕ = false
svar_has_negative_occurrence dbi
ϕ^[evar :X↦patt_free_evar x] = false
erewrite -> (proj2 (proj2 (IHϕ _ _ _))); eauto .
Qed .
Corollary positive_occurrence_evar_open : forall (ϕ : Pattern) (X : svar) (dbi : db_index) (x : evar ),
svar_has_positive_occurrence X (ϕ^{evar : dbi ↦ x}) = false <-> svar_has_positive_occurrence X ϕ = false.Σ : Signature
∀ (ϕ : Pattern) (X : svar) (dbi : db_index) (x : evar ),
svar_has_positive_occurrence X ϕ^{evar :dbi↦x} =
false ↔ svar_has_positive_occurrence X ϕ = false
Proof .Σ : Signature
∀ (ϕ : Pattern) (X : svar) (dbi : db_index) (x : evar ),
svar_has_positive_occurrence X ϕ^{evar :dbi↦x} =
false ↔ svar_has_positive_occurrence X ϕ = false
apply positive_negative_occurrence_evar_open.
Qed .
Corollary negative_occurrence_evar_open : forall (ϕ : Pattern) (X : svar) (dbi : db_index) (x : evar ),
svar_has_negative_occurrence X (ϕ^{evar : dbi ↦ x}) = false <-> svar_has_negative_occurrence X ϕ = false.Σ : Signature
∀ (ϕ : Pattern) (X : svar) (dbi : db_index) (x : evar ),
svar_has_negative_occurrence X ϕ^{evar :dbi↦x} =
false ↔ svar_has_negative_occurrence X ϕ = false
Proof .Σ : Signature
∀ (ϕ : Pattern) (X : svar) (dbi : db_index) (x : evar ),
svar_has_negative_occurrence X ϕ^{evar :dbi↦x} =
false ↔ svar_has_negative_occurrence X ϕ = false
apply positive_negative_occurrence_evar_open.
Qed .
Lemma positive_negative_occurrence_db_svar_open_le : forall (phi : Pattern) (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2 ->
(
no_positive_occurrence_db_b dbi1 phi ->
no_positive_occurrence_db_b dbi1 (phi^{svar: dbi2 ↦ X})
)
/\ (no_negative_occurrence_db_b dbi1 phi -> no_negative_occurrence_db_b dbi1 (phi^{svar: dbi2 ↦ X})).Σ : Signature
∀ (phi : Pattern) (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi
→ no_positive_occurrence_db_b dbi1
phi^{svar:dbi2↦X})
∧ (no_negative_occurrence_db_b dbi1 phi
→ no_negative_occurrence_db_b dbi1
phi^{svar:dbi2↦X})
Proof .Σ : Signature
∀ (phi : Pattern) (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi
→ no_positive_occurrence_db_b dbi1
phi^{svar:dbi2↦X})
∧ (no_negative_occurrence_db_b dbi1 phi
→ no_negative_occurrence_db_b dbi1
phi^{svar:dbi2↦X})
unfold svar_open.Σ : Signature
∀ (phi : Pattern) (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi
→ no_positive_occurrence_db_b dbi1
phi^[svar:dbi2↦patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi
→ no_negative_occurrence_db_b dbi1
phi^[svar:dbi2↦patt_free_svar X])
induction phi; intros dbi1 dbi2 X Hneq; split ; intros H; simpl in *; auto ; cbn in *.Σ : Signature n, dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H : if decide (n = dbi1) then false else true
no_positive_occurrence_db_b dbi1
match compare_nat n dbi2 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar X
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end
+ Σ : Signature n, dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H : if decide (n = dbi1) then false else true
no_positive_occurrence_db_b dbi1
match compare_nat n dbi2 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar X
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end
do 2 case_match; auto ; cbn ; case_match; auto .Σ : Signature n, dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 n0 : n ≠ dbi1 H0 : decide (n = dbi1) = right n0 H : true g : n > dbi2 H1 : compare_nat n dbi2 = Nat_greater n dbi2 g e : Nat.pred n = dbi1 H2 : decide (Nat.pred n = dbi1) = left e
false
lia .
+ Σ : Signature n, dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H : true
no_negative_occurrence_db_b dbi1
match compare_nat n dbi2 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar X
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end
case_match; constructor ; auto .
+ Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi1
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi1
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])IHphi2 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi2
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi2
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H : no_positive_occurrence_db_b dbi1 phi1 &&
no_positive_occurrence_db_b dbi1 phi2
no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦patt_free_svar X] &&
no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦patt_free_svar X]
destruct_and!; split_and!. Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi1
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi1
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])IHphi2 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi2
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi2
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H0 : no_positive_occurrence_db_b dbi1 phi1 = true H1 : no_positive_occurrence_db_b dbi1 phi2 = true
no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦patt_free_svar X] = true
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi1
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi1
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])IHphi2 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi2
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi2
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H0 : no_positive_occurrence_db_b dbi1 phi1 = true H1 : no_positive_occurrence_db_b dbi1 phi2 = true
no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦patt_free_svar X] = true
now apply IHphi1.
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi1
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi1
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])IHphi2 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi2
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi2
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H0 : no_positive_occurrence_db_b dbi1 phi1 = true H1 : no_positive_occurrence_db_b dbi1 phi2 = true
no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦patt_free_svar X] = true
now apply IHphi2.
+ Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi1
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi1
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])IHphi2 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi2
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi2
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H : no_negative_occurrence_db_b dbi1 phi1 &&
no_negative_occurrence_db_b dbi1 phi2
no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦patt_free_svar X] &&
no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦patt_free_svar X]
destruct_and!; split_and!. Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi1
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi1
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])IHphi2 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi2
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi2
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H0 : no_negative_occurrence_db_b dbi1 phi1 = true H1 : no_negative_occurrence_db_b dbi1 phi2 = true
no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦patt_free_svar X] = true
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi1
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi1
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])IHphi2 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi2
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi2
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H0 : no_negative_occurrence_db_b dbi1 phi1 = true H1 : no_negative_occurrence_db_b dbi1 phi2 = true
no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦patt_free_svar X] = true
now apply IHphi1.
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi1
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi1
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])IHphi2 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi2
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi2
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H0 : no_negative_occurrence_db_b dbi1 phi1 = true H1 : no_negative_occurrence_db_b dbi1 phi2 = true
no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦patt_free_svar X] = true
now apply IHphi2.
+ Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi1
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi1
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])IHphi2 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi2
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi2
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 &&
no_positive_occurrence_db_b dbi1 phi2
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1
phi1^[svar:dbi2↦patt_free_svar X] &&
no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦patt_free_svar X]
destruct_and!; split_and!. Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi1
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi1
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])IHphi2 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi2
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi2
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H0 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 = true H1 : no_positive_occurrence_db_b dbi1 phi2 = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1
phi1^[svar:dbi2↦patt_free_svar X] = true
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi1
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi1
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])IHphi2 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi2
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi2
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H0 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 = true H1 : no_positive_occurrence_db_b dbi1 phi2 = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1
phi1^[svar:dbi2↦patt_free_svar X] = true
now apply IHphi1.
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi1
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi1
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])IHphi2 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi2
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi2
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H0 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 = true H1 : no_positive_occurrence_db_b dbi1 phi2 = true
no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦patt_free_svar X] = true
now apply IHphi2.
+ Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi1
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi1
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])IHphi2 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi2
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi2
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 &&
no_negative_occurrence_db_b dbi1 phi2
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1
phi1^[svar:dbi2↦patt_free_svar X] &&
no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦patt_free_svar X]
destruct_and!; split_and!. Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi1
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi1
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])IHphi2 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi2
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi2
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H0 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 = true H1 : no_negative_occurrence_db_b dbi1 phi2 = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1
phi1^[svar:dbi2↦patt_free_svar X] = true
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi1
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi1
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])IHphi2 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi2
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi2
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H0 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 = true H1 : no_negative_occurrence_db_b dbi1 phi2 = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1
phi1^[svar:dbi2↦patt_free_svar X] = true
now apply IHphi1.
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi1
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi1
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦
patt_free_svar X])IHphi2 : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi2
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi2
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H0 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 = true H1 : no_negative_occurrence_db_b dbi1 phi2 = true
no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦patt_free_svar X] = true
now apply IHphi2.
+ Σ : Signature phi : Pattern IHphi : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi
→ no_positive_occurrence_db_b dbi1
phi^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi
→ no_negative_occurrence_db_b dbi1
phi^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H : no_positive_occurrence_db_b dbi1 phi
no_positive_occurrence_db_b dbi1
phi^[svar:dbi2↦patt_free_svar X]
now apply IHphi.
+ Σ : Signature phi : Pattern IHphi : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi
→ no_positive_occurrence_db_b dbi1
phi^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi
→ no_negative_occurrence_db_b dbi1
phi^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H : no_negative_occurrence_db_b dbi1 phi
no_negative_occurrence_db_b dbi1
phi^[svar:dbi2↦patt_free_svar X]
now apply IHphi.
+ Σ : Signature phi : Pattern IHphi : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi
→ no_positive_occurrence_db_b dbi1
phi^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi
→ no_negative_occurrence_db_b dbi1
phi^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H : no_positive_occurrence_db_b (S dbi1) phi
no_positive_occurrence_db_b (S dbi1)
phi^[svar:S dbi2↦patt_free_svar X]
apply IHphi; auto .Σ : Signature phi : Pattern IHphi : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi
→ no_positive_occurrence_db_b dbi1
phi^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi
→ no_negative_occurrence_db_b dbi1
phi^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H : no_positive_occurrence_db_b (S dbi1) phi
S dbi1 < S dbi2
lia .
+ Σ : Signature phi : Pattern IHphi : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi
→ no_positive_occurrence_db_b dbi1
phi^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi
→ no_negative_occurrence_db_b dbi1
phi^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H : no_negative_occurrence_db_b (S dbi1) phi
no_negative_occurrence_db_b (S dbi1)
phi^[svar:S dbi2↦patt_free_svar X]
apply IHphi; auto .Σ : Signature phi : Pattern IHphi : ∀ (dbi1 dbi2 : db_index) (X : svar),
dbi1 < dbi2
→ (no_positive_occurrence_db_b dbi1 phi
→ no_positive_occurrence_db_b dbi1
phi^[svar:dbi2↦
patt_free_svar X])
∧ (no_negative_occurrence_db_b dbi1 phi
→ no_negative_occurrence_db_b dbi1
phi^[svar:dbi2↦
patt_free_svar X])dbi1, dbi2 : db_index X : svar Hneq : dbi1 < dbi2 H : no_negative_occurrence_db_b (S dbi1) phi
S dbi1 < S dbi2
lia .
Qed .
Lemma wfp_svar_open : forall (phi : Pattern) (dbi : db_index) (X : svar),
well_formed_positive phi = true ->
well_formed_positive (phi^{svar: dbi ↦ X}) = true.Σ : Signature
∀ (phi : Pattern) (dbi : db_index) (X : svar),
well_formed_positive phi = true
→ well_formed_positive phi^{svar:dbi↦X} = true
Proof .Σ : Signature
∀ (phi : Pattern) (dbi : db_index) (X : svar),
well_formed_positive phi = true
→ well_formed_positive phi^{svar:dbi↦X} = true
unfold svar_open.Σ : Signature
∀ (phi : Pattern) (dbi : db_index) (X : svar),
well_formed_positive phi = true
→ well_formed_positive
phi^[svar:dbi↦patt_free_svar X] = true
induction phi; simpl ; intros dbi X H.Σ : Signature x : evar dbi : db_index X : svar H : true = true
true = true
+ Σ : Signature x : evar dbi : db_index X : svar H : true = true
true = true
constructor .
+ Σ : Signature x : svar dbi : db_index X : svar H : true = true
true = true
constructor .
+ Σ : Signature n, dbi : db_index X : svar H : true = true
true = true
constructor .
+ Σ : Signature n, dbi : db_index X : svar H : true = true
well_formed_positive
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar X
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end = true
simpl .Σ : Signature n, dbi : db_index X : svar H : true = true
well_formed_positive
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar X
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end = true
case_match; constructor .
+ Σ : Signature sigma : symbols dbi : db_index X : svar H : true = true
true = true
constructor .
+ Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H : well_formed_positive phi1 &&
well_formed_positive phi2 = true
well_formed_positive phi1^[svar:dbi↦patt_free_svar X] &&
well_formed_positive phi2^[svar:dbi↦patt_free_svar X] =
true
inversion H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H, H1 : well_formed_positive phi1 &&
well_formed_positive phi2 = true
well_formed_positive phi1^[svar:dbi↦patt_free_svar X] &&
well_formed_positive phi2^[svar:dbi↦patt_free_svar X] =
well_formed_positive phi1 && well_formed_positive phi2
apply andb_true_iff in H1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H : well_formed_positive phi1 &&
well_formed_positive phi2 = true H1 : well_formed_positive phi1 = true
∧ well_formed_positive phi2 = true
well_formed_positive phi1^[svar:dbi↦patt_free_svar X] &&
well_formed_positive phi2^[svar:dbi↦patt_free_svar X] =
well_formed_positive phi1 && well_formed_positive phi2
destruct H1 as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H : well_formed_positive phi1 &&
well_formed_positive phi2 = true H1 : well_formed_positive phi1 = true H2 : well_formed_positive phi2 = true
well_formed_positive phi1^[svar:dbi↦patt_free_svar X] &&
well_formed_positive phi2^[svar:dbi↦patt_free_svar X] =
well_formed_positive phi1 && well_formed_positive phi2
rewrite IHphi1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H : well_formed_positive phi1 &&
well_formed_positive phi2 = true H1 : well_formed_positive phi1 = true H2 : well_formed_positive phi2 = true
well_formed_positive phi1 = true
assumption .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H : well_formed_positive phi1 &&
well_formed_positive phi2 = true H1 : well_formed_positive phi1 = true H2 : well_formed_positive phi2 = true
true &&
well_formed_positive phi2^[svar:dbi↦patt_free_svar X] =
well_formed_positive phi1 && well_formed_positive phi2
rewrite IHphi2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H : well_formed_positive phi1 &&
well_formed_positive phi2 = true H1 : well_formed_positive phi1 = true H2 : well_formed_positive phi2 = true
well_formed_positive phi2 = true
assumption .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H : well_formed_positive phi1 &&
well_formed_positive phi2 = true H1 : well_formed_positive phi1 = true H2 : well_formed_positive phi2 = true
true && true =
well_formed_positive phi1 && well_formed_positive phi2
destruct_and!. Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H0 : well_formed_positive phi1 = true H3 : well_formed_positive phi2 = true H1 : well_formed_positive phi1 = true H2 : well_formed_positive phi2 = true
true && true =
well_formed_positive phi1 && well_formed_positive phi2
symmetry .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H0 : well_formed_positive phi1 = true H3 : well_formed_positive phi2 = true H1 : well_formed_positive phi1 = true H2 : well_formed_positive phi2 = true
well_formed_positive phi1 && well_formed_positive phi2 =
true && true
simpl .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H0 : well_formed_positive phi1 = true H3 : well_formed_positive phi2 = true H1 : well_formed_positive phi1 = true H2 : well_formed_positive phi2 = true
well_formed_positive phi1 && well_formed_positive phi2 =
true
split_and!; auto .
+ Σ : Signature dbi : db_index X : svar H : true = true
true = true
constructor .
+ Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H : well_formed_positive phi1 &&
well_formed_positive phi2 = true
well_formed_positive phi1^[svar:dbi↦patt_free_svar X] &&
well_formed_positive phi2^[svar:dbi↦patt_free_svar X] =
true
apply andb_true_iff in H.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H : well_formed_positive phi1 = true
∧ well_formed_positive phi2 = true
well_formed_positive phi1^[svar:dbi↦patt_free_svar X] &&
well_formed_positive phi2^[svar:dbi↦patt_free_svar X] =
true
destruct H as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H1 : well_formed_positive phi1 = true H2 : well_formed_positive phi2 = true
well_formed_positive phi1^[svar:dbi↦patt_free_svar X] &&
well_formed_positive phi2^[svar:dbi↦patt_free_svar X] =
true
rewrite IHphi1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H1 : well_formed_positive phi1 = true H2 : well_formed_positive phi2 = true
well_formed_positive phi1 = true
apply H1.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H1 : well_formed_positive phi1 = true H2 : well_formed_positive phi2 = true
true &&
well_formed_positive phi2^[svar:dbi↦patt_free_svar X] =
true
rewrite IHphi2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H1 : well_formed_positive phi1 = true H2 : well_formed_positive phi2 = true
well_formed_positive phi2 = true
apply H2.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi1 = true
→ well_formed_positive
phi1^[svar:dbi↦patt_free_svar X] = trueIHphi2 : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi2 = true
→ well_formed_positive
phi2^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H1 : well_formed_positive phi1 = true H2 : well_formed_positive phi2 = true
true && true = true
reflexivity .
+ Σ : Signature phi : Pattern IHphi : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi = true
→ well_formed_positive
phi^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H : well_formed_positive phi = true
well_formed_positive phi^[svar:dbi↦patt_free_svar X] =
true
simpl in H.Σ : Signature phi : Pattern IHphi : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi = true
→ well_formed_positive
phi^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H : well_formed_positive phi = true
well_formed_positive phi^[svar:dbi↦patt_free_svar X] =
true
simpl .Σ : Signature phi : Pattern IHphi : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi = true
→ well_formed_positive
phi^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H : well_formed_positive phi = true
well_formed_positive phi^[svar:dbi↦patt_free_svar X] =
true
auto .
+ Σ : Signature phi : Pattern IHphi : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi = true
→ well_formed_positive
phi^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H : no_negative_occurrence_db_b 0 phi &&
well_formed_positive phi = true
no_negative_occurrence_db_b 0
phi^[svar:S dbi↦patt_free_svar X] &&
well_formed_positive phi^[svar:S dbi↦patt_free_svar X] =
true
simpl in H.Σ : Signature phi : Pattern IHphi : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi = true
→ well_formed_positive
phi^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H : no_negative_occurrence_db_b 0 phi &&
well_formed_positive phi = true
no_negative_occurrence_db_b 0
phi^[svar:S dbi↦patt_free_svar X] &&
well_formed_positive phi^[svar:S dbi↦patt_free_svar X] =
true
simpl .Σ : Signature phi : Pattern IHphi : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi = true
→ well_formed_positive
phi^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H : no_negative_occurrence_db_b 0 phi &&
well_formed_positive phi = true
no_negative_occurrence_db_b 0
phi^[svar:S dbi↦patt_free_svar X] &&
well_formed_positive phi^[svar:S dbi↦patt_free_svar X] =
true
apply andb_true_iff in H.Σ : Signature phi : Pattern IHphi : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi = true
→ well_formed_positive
phi^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H : no_negative_occurrence_db_b 0 phi = true
∧ well_formed_positive phi = true
no_negative_occurrence_db_b 0
phi^[svar:S dbi↦patt_free_svar X] &&
well_formed_positive phi^[svar:S dbi↦patt_free_svar X] =
true
destruct H as [H1 H2].Σ : Signature phi : Pattern IHphi : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi = true
→ well_formed_positive
phi^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H1 : no_negative_occurrence_db_b 0 phi = true H2 : well_formed_positive phi = true
no_negative_occurrence_db_b 0
phi^[svar:S dbi↦patt_free_svar X] &&
well_formed_positive phi^[svar:S dbi↦patt_free_svar X] =
true
rewrite IHphi.Σ : Signature phi : Pattern IHphi : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi = true
→ well_formed_positive
phi^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H1 : no_negative_occurrence_db_b 0 phi = true H2 : well_formed_positive phi = true
well_formed_positive phi = true
apply H2.Σ : Signature phi : Pattern IHphi : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi = true
→ well_formed_positive
phi^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H1 : no_negative_occurrence_db_b 0 phi = true H2 : well_formed_positive phi = true
no_negative_occurrence_db_b 0
phi^[svar:S dbi↦patt_free_svar X] && true = true
rewrite andb_true_r.Σ : Signature phi : Pattern IHphi : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi = true
→ well_formed_positive
phi^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H1 : no_negative_occurrence_db_b 0 phi = true H2 : well_formed_positive phi = true
no_negative_occurrence_db_b 0
phi^[svar:S dbi↦patt_free_svar X] = true
apply positive_negative_occurrence_db_svar_open_le; auto .Σ : Signature phi : Pattern IHphi : ∀ (dbi : db_index) (X : svar),
well_formed_positive phi = true
→ well_formed_positive
phi^[svar:dbi↦patt_free_svar X] = truedbi : db_index X : svar H1 : no_negative_occurrence_db_b 0 phi = true H2 : well_formed_positive phi = true
0 < S dbi
lia .
Qed .
Lemma positive_negative_occurrence_named_svar_open :
forall (phi : Pattern) (X Y : svar) (dbi : db_index),
X <> Y ->
(
svar_has_negative_occurrence X phi = false ->
svar_has_negative_occurrence X (phi^{svar: dbi ↦ Y}) = false
) /\ (
svar_has_positive_occurrence X phi = false ->
svar_has_positive_occurrence X (phi^{svar: dbi ↦ Y}) = false
).Σ : Signature
∀ (phi : Pattern) (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi = false
→ svar_has_negative_occurrence X phi^{svar:dbi↦Y} =
false)
∧ (svar_has_positive_occurrence X phi = false
→ svar_has_positive_occurrence X
phi^{svar:dbi↦Y} = false)
Proof .Σ : Signature
∀ (phi : Pattern) (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi = false
→ svar_has_negative_occurrence X phi^{svar:dbi↦Y} =
false)
∧ (svar_has_positive_occurrence X phi = false
→ svar_has_positive_occurrence X
phi^{svar:dbi↦Y} = false)
unfold svar_open.Σ : Signature
∀ (phi : Pattern) (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi = false
→ svar_has_negative_occurrence X
phi^[svar:dbi↦patt_free_svar Y] = false)
∧ (svar_has_positive_occurrence X phi = false
→ svar_has_positive_occurrence X
phi^[svar:dbi↦patt_free_svar Y] = false)
induction phi; intros X Y dbi XneY; split ; intros Hneg; simpl in *; auto ; try firstorder .Σ : Signature n : db_index X, Y : svar dbi : db_index XneY : X ≠ Y Hneg : svar_has_negative_occurrence X
(patt_bound_svar n) = false
svar_has_negative_occurrence X
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar Y
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end = false
- Σ : Signature n : db_index X, Y : svar dbi : db_index XneY : X ≠ Y Hneg : svar_has_negative_occurrence X
(patt_bound_svar n) = false
svar_has_negative_occurrence X
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar Y
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end = false
now case_match.
- Σ : Signature n : db_index X, Y : svar dbi : db_index XneY : X ≠ Y Hneg : svar_has_positive_occurrence X
(patt_bound_svar n) = false
svar_has_positive_occurrence X
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar Y
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end = false
case_match; try auto . Σ : Signature n : db_index X, Y : svar dbi : db_index XneY : X ≠ Y Hneg : svar_has_positive_occurrence X
(patt_bound_svar n) = false e : n = dbi H : compare_nat n dbi = Nat_equal n dbi e
svar_has_positive_occurrence X (patt_free_svar Y) =
false
cbn .Σ : Signature n : db_index X, Y : svar dbi : db_index XneY : X ≠ Y Hneg : svar_has_positive_occurrence X
(patt_bound_svar n) = false e : n = dbi H : compare_nat n dbi = Nat_equal n dbi e
(if decide (X = Y) then true else false) = false
case_match; auto . Σ : Signature n : db_index X, Y : svar dbi : db_index XneY : X ≠ Y Hneg : svar_has_positive_occurrence X
(patt_bound_svar n) = false e : n = dbi H : compare_nat n dbi = Nat_equal n dbi e e0 : X = Y H0 : decide (X = Y) = left e0
true = false
congruence .
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦
patt_free_svar Y] = false)IHphi2 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦
patt_free_svar Y] = false)X, Y : svar dbi : db_index XneY : X ≠ Y Hneg : svar_has_negative_occurrence X
(patt_app phi1 phi2) = false
svar_has_negative_occurrence X
(patt_app phi1^[svar:dbi↦patt_free_svar Y]
phi2^[svar:dbi↦patt_free_svar Y]) = false
apply orb_false_iff in Hneg as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦
patt_free_svar Y] = false)IHphi2 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦
patt_free_svar Y] = false)X, Y : svar dbi : db_index XneY : X ≠ Y H1 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X phi1 = false H2 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X phi2 = false
svar_has_negative_occurrence X
(patt_app phi1^[svar:dbi↦patt_free_svar Y]
phi2^[svar:dbi↦patt_free_svar Y]) = false
cbn .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦
patt_free_svar Y] = false)IHphi2 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦
patt_free_svar Y] = false)X, Y : svar dbi : db_index XneY : X ≠ Y H1 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X phi1 = false H2 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X phi2 = false
svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar Y]
|| svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] = false
now erewrite -> (proj1 (IHphi1 X Y dbi XneY)), -> (proj1 (IHphi2 X Y dbi XneY)).
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦
patt_free_svar Y] = false)IHphi2 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦
patt_free_svar Y] = false)X, Y : svar dbi : db_index XneY : X ≠ Y Hneg : svar_has_positive_occurrence X
(patt_app phi1 phi2) = false
svar_has_positive_occurrence X
(patt_app phi1^[svar:dbi↦patt_free_svar Y]
phi2^[svar:dbi↦patt_free_svar Y]) = false
apply orb_false_iff in Hneg as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦
patt_free_svar Y] = false)IHphi2 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦
patt_free_svar Y] = false)X, Y : svar dbi : db_index XneY : X ≠ Y H1 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X phi1 = false H2 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X phi2 = false
svar_has_positive_occurrence X
(patt_app phi1^[svar:dbi↦patt_free_svar Y]
phi2^[svar:dbi↦patt_free_svar Y]) = false
cbn .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦
patt_free_svar Y] = false)IHphi2 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦
patt_free_svar Y] = false)X, Y : svar dbi : db_index XneY : X ≠ Y H1 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X phi1 = false H2 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X phi2 = false
svar_has_positive_occurrence X
phi1^[svar:dbi↦patt_free_svar Y]
|| svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] = false
now erewrite -> (proj2 (IHphi1 X Y dbi XneY)), -> (proj2 (IHphi2 X Y dbi XneY)).
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦
patt_free_svar Y] = false)IHphi2 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦
patt_free_svar Y] = false)X, Y : svar dbi : db_index XneY : X ≠ Y Hneg : svar_has_negative_occurrence X
(patt_imp phi1 phi2) = false
svar_has_negative_occurrence X
(patt_imp phi1^[svar:dbi↦patt_free_svar Y]
phi2^[svar:dbi↦patt_free_svar Y]) = false
apply orb_false_iff in Hneg as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦
patt_free_svar Y] = false)IHphi2 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦
patt_free_svar Y] = false)X, Y : svar dbi : db_index XneY : X ≠ Y H1 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X phi1 = false H2 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X phi2 = false
svar_has_negative_occurrence X
(patt_imp phi1^[svar:dbi↦patt_free_svar Y]
phi2^[svar:dbi↦patt_free_svar Y]) = false
cbn .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦
patt_free_svar Y] = false)IHphi2 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦
patt_free_svar Y] = false)X, Y : svar dbi : db_index XneY : X ≠ Y H1 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X phi1 = false H2 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X phi2 = false
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X
phi1^[svar:dbi↦patt_free_svar Y]
|| svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] = false
fold svar_has_positive_occurrence.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦
patt_free_svar Y] = false)IHphi2 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦
patt_free_svar Y] = false)X, Y : svar dbi : db_index XneY : X ≠ Y H1 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X phi1 = false H2 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X phi2 = false
svar_has_positive_occurrence X
phi1^[svar:dbi↦patt_free_svar Y]
|| svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] = false
now erewrite -> (proj2 (IHphi1 X Y dbi XneY)), -> (proj1 (IHphi2 X Y dbi XneY)).
- Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦
patt_free_svar Y] = false)IHphi2 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦
patt_free_svar Y] = false)X, Y : svar dbi : db_index XneY : X ≠ Y Hneg : svar_has_positive_occurrence X
(patt_imp phi1 phi2) = false
svar_has_positive_occurrence X
(patt_imp phi1^[svar:dbi↦patt_free_svar Y]
phi2^[svar:dbi↦patt_free_svar Y]) = false
apply orb_false_iff in Hneg as [H1 H2].Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦
patt_free_svar Y] = false)IHphi2 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦
patt_free_svar Y] = false)X, Y : svar dbi : db_index XneY : X ≠ Y H1 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X phi1 = false H2 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X phi2 = false
svar_has_positive_occurrence X
(patt_imp phi1^[svar:dbi↦patt_free_svar Y]
phi2^[svar:dbi↦patt_free_svar Y]) = false
cbn .Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦
patt_free_svar Y] = false)IHphi2 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦
patt_free_svar Y] = false)X, Y : svar dbi : db_index XneY : X ≠ Y H1 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X phi1 = false H2 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X phi2 = false
(fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X
phi1^[svar:dbi↦patt_free_svar Y]
|| svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] = false
fold svar_has_negative_occurrence.Σ : Signature phi1, phi2 : Pattern IHphi1 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi1 =
false
→ svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi1 =
false
→ svar_has_positive_occurrence X
phi1^[svar:dbi↦
patt_free_svar Y] = false)IHphi2 : ∀ (X Y : svar) (dbi : db_index),
X ≠ Y
→ (svar_has_negative_occurrence X phi2 =
false
→ svar_has_negative_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] =
false)
∧ (svar_has_positive_occurrence X phi2 =
false
→ svar_has_positive_occurrence X
phi2^[svar:dbi↦
patt_free_svar Y] = false)X, Y : svar dbi : db_index XneY : X ≠ Y H1 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X phi1 = false H2 : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X phi2 = false
svar_has_negative_occurrence X
phi1^[svar:dbi↦patt_free_svar Y]
|| svar_has_positive_occurrence X
phi2^[svar:dbi↦patt_free_svar Y] = false
now erewrite -> (proj1 (IHphi1 X Y dbi XneY)), -> (proj2 (IHphi2 X Y dbi XneY)).
Qed .
Corollary evar_open_wfc_aux db1 db2 X phi :
db1 <= db2 ->
well_formed_closed_ex_aux phi db1 ->
phi^{evar : db2 ↦ X} = phi.Σ : Signature db1, db2 : nat X : evar phi : Pattern
db1 ≤ db2
→ well_formed_closed_ex_aux phi db1
→ phi^{evar :db2↦X} = phi
Proof .Σ : Signature db1, db2 : nat X : evar phi : Pattern
db1 ≤ db2
→ well_formed_closed_ex_aux phi db1
→ phi^{evar :db2↦X} = phi
intros H H0.Σ : Signature db1, db2 : nat X : evar phi : Pattern H : db1 ≤ db2 H0 : well_formed_closed_ex_aux phi db1
phi^{evar :db2↦X} = phi
unfold evar_open.Σ : Signature db1, db2 : nat X : evar phi : Pattern H : db1 ≤ db2 H0 : well_formed_closed_ex_aux phi db1
phi^[evar :db2↦patt_free_evar X] = phi
eapply well_formed_bevar_subst.Σ : Signature db1, db2 : nat X : evar phi : Pattern H : db1 ≤ db2 H0 : well_formed_closed_ex_aux phi db1
db2 ≥ ?n
2 : eassumption .Σ : Signature db1, db2 : nat X : evar phi : Pattern H : db1 ≤ db2 H0 : well_formed_closed_ex_aux phi db1
db2 ≥ db1
auto .
Qed .
Corollary evar_open_wfc m X phi : well_formed_closed_ex_aux phi 0 -> phi^{evar : m ↦ X} = phi.Σ : Signature m : db_index X : evar phi : Pattern
well_formed_closed_ex_aux phi 0 → phi^{evar :m↦X} = phi
Proof .Σ : Signature m : db_index X : evar phi : Pattern
well_formed_closed_ex_aux phi 0 → phi^{evar :m↦X} = phi
intros H.Σ : Signature m : db_index X : evar phi : Pattern H : well_formed_closed_ex_aux phi 0
phi^{evar :m↦X} = phi
unfold well_formed_closed in H.Σ : Signature m : db_index X : evar phi : Pattern H : well_formed_closed_ex_aux phi 0
phi^{evar :m↦X} = phi
apply evar_open_wfc_aux with (X := X)(db2 := m) in H.Σ : Signature m : db_index X : evar phi : Pattern H : phi^{evar :m↦X} = phi
phi^{evar :m↦X} = phi
2 : lia .Σ : Signature m : db_index X : evar phi : Pattern H : phi^{evar :m↦X} = phi
phi^{evar :m↦X} = phi
auto .
Qed .
Corollary svar_open_wfc_aux db1 db2 X phi :
db1 <= db2 ->
well_formed_closed_mu_aux phi db1 ->
phi^{svar: db2 ↦ X} = phi.Σ : Signature db1, db2 : nat X : svar phi : Pattern
db1 ≤ db2
→ well_formed_closed_mu_aux phi db1
→ phi^{svar:db2↦X} = phi
Proof .Σ : Signature db1, db2 : nat X : svar phi : Pattern
db1 ≤ db2
→ well_formed_closed_mu_aux phi db1
→ phi^{svar:db2↦X} = phi
intros H H0.Σ : Signature db1, db2 : nat X : svar phi : Pattern H : db1 ≤ db2 H0 : well_formed_closed_mu_aux phi db1
phi^{svar:db2↦X} = phi
unfold evar_open.Σ : Signature db1, db2 : nat X : svar phi : Pattern H : db1 ≤ db2 H0 : well_formed_closed_mu_aux phi db1
phi^{svar:db2↦X} = phi
eapply well_formed_bsvar_subst.Σ : Signature db1, db2 : nat X : svar phi : Pattern H : db1 ≤ db2 H0 : well_formed_closed_mu_aux phi db1
db2 ≥ ?k
2 : eassumption .Σ : Signature db1, db2 : nat X : svar phi : Pattern H : db1 ≤ db2 H0 : well_formed_closed_mu_aux phi db1
db2 ≥ db1
auto .
Qed .
Corollary svar_open_wfc m X phi : well_formed_closed_mu_aux phi 0 -> phi^{svar: m ↦ X} = phi.Σ : Signature m : db_index X : svar phi : Pattern
well_formed_closed_mu_aux phi 0 → phi^{svar:m↦X} = phi
Proof .Σ : Signature m : db_index X : svar phi : Pattern
well_formed_closed_mu_aux phi 0 → phi^{svar:m↦X} = phi
intros H.Σ : Signature m : db_index X : svar phi : Pattern H : well_formed_closed_mu_aux phi 0
phi^{svar:m↦X} = phi
unfold well_formed_closed in H.Σ : Signature m : db_index X : svar phi : Pattern H : well_formed_closed_mu_aux phi 0
phi^{svar:m↦X} = phi
apply svar_open_wfc_aux with (X := X)(db2 := m) in H.Σ : Signature m : db_index X : svar phi : Pattern H : phi^{svar:m↦X} = phi
phi^{svar:m↦X} = phi
2 : lia .Σ : Signature m : db_index X : svar phi : Pattern H : phi^{svar:m↦X} = phi
phi^{svar:m↦X} = phi
auto .
Qed .
Corollary evar_open_bsvar_subst m phi1 phi2 dbi X
: well_formed_closed phi2 ->
phi1^[svar: dbi ↦ phi2]^{evar : m ↦ X}
= phi1^{evar : m ↦ X}^[svar: dbi ↦ phi2].Σ : Signature m : db_index phi1, phi2 : Pattern dbi : db_index X : evar
well_formed_closed phi2
→ phi1^[svar:dbi↦phi2]^{evar :m↦X} =
phi1^{evar :m↦X}^[svar:dbi↦phi2]
Proof .Σ : Signature m : db_index phi1, phi2 : Pattern dbi : db_index X : evar
well_formed_closed phi2
→ phi1^[svar:dbi↦phi2]^{evar :m↦X} =
phi1^{evar :m↦X}^[svar:dbi↦phi2]
intro H.Σ : Signature m : db_index phi1, phi2 : Pattern dbi : db_index X : evar H : well_formed_closed phi2
phi1^[svar:dbi↦phi2]^{evar :m↦X} =
phi1^{evar :m↦X}^[svar:dbi↦phi2]
apply bevar_subst_bsvar_subst; auto .
Qed .
Corollary svar_open_bevar_subst m phi1 phi2 dbi X
: well_formed_closed phi2 ->
phi1^[evar : dbi ↦ phi2]^{svar: m ↦ X}
= phi1^{svar: m ↦ X}^[evar : dbi ↦ phi2].Σ : Signature m : db_index phi1, phi2 : Pattern dbi : db_index X : svar
well_formed_closed phi2
→ phi1^[evar :dbi↦phi2]^{svar:m↦X} =
phi1^{svar:m↦X}^[evar :dbi↦phi2]
Proof .Σ : Signature m : db_index phi1, phi2 : Pattern dbi : db_index X : svar
well_formed_closed phi2
→ phi1^[evar :dbi↦phi2]^{svar:m↦X} =
phi1^{svar:m↦X}^[evar :dbi↦phi2]
intro H.Σ : Signature m : db_index phi1, phi2 : Pattern dbi : db_index X : svar H : well_formed_closed phi2
phi1^[evar :dbi↦phi2]^{svar:m↦X} =
phi1^{svar:m↦X}^[evar :dbi↦phi2]
apply eq_sym, bevar_subst_bsvar_subst; auto .
Qed .
Corollary svar_open_bsvar_subst_higher m phi1 phi2 dbi X
: well_formed_closed phi2 ->
m < dbi ->
phi1^[svar: dbi ↦ phi2]^{svar: m ↦ X}
= phi1^{svar: m ↦ X}^[svar: pred dbi ↦ phi2].Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : svar
well_formed_closed phi2
→ m < dbi
→ phi1^[svar:dbi↦phi2]^{svar:m↦X} =
phi1^{svar:m↦X}^[svar:Init.Nat.pred dbi↦phi2]
Proof .Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : svar
well_formed_closed phi2
→ m < dbi
→ phi1^[svar:dbi↦phi2]^{svar:m↦X} =
phi1^{svar:m↦X}^[svar:Init.Nat.pred dbi↦phi2]
intros H H0.Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : svar H : well_formed_closed phi2 H0 : m < dbi
phi1^[svar:dbi↦phi2]^{svar:m↦X} =
phi1^{svar:m↦X}^[svar:Init.Nat.pred dbi↦phi2]
apply bsvar_subst_comm_higher; auto .Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : svar H : well_formed_closed phi2 H0 : m < dbi
well_formed_closed_mu_aux phi2 0
unfold well_formed_closed in *.Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : svar H : well_formed_closed_mu_aux phi2 0 &&
well_formed_closed_ex_aux phi2 0 H0 : m < dbi
well_formed_closed_mu_aux phi2 0
destruct_and!. Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : svar H1 : well_formed_closed_mu_aux phi2 0 = true H2 : well_formed_closed_ex_aux phi2 0 = true H0 : m < dbi
well_formed_closed_mu_aux phi2 0
auto .
Qed .
Corollary svar_open_bsvar_subst_lower m phi1 phi2 dbi X
: well_formed_closed phi2 ->
m > dbi ->
phi1^[svar: dbi ↦ phi2]^{svar: m ↦ X}
= phi1^{svar: S m ↦ X}^[svar: dbi ↦ phi2].Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : svar
well_formed_closed phi2
→ m > dbi
→ phi1^[svar:dbi↦phi2]^{svar:m↦X} =
phi1^{svar:S m↦X}^[svar:dbi↦phi2]
Proof .Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : svar
well_formed_closed phi2
→ m > dbi
→ phi1^[svar:dbi↦phi2]^{svar:m↦X} =
phi1^{svar:S m↦X}^[svar:dbi↦phi2]
intros H H0.Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : svar H : well_formed_closed phi2 H0 : m > dbi
phi1^[svar:dbi↦phi2]^{svar:m↦X} =
phi1^{svar:S m↦X}^[svar:dbi↦phi2]
apply bsvar_subst_comm_lower; auto .Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : svar H : well_formed_closed phi2 H0 : m > dbi
well_formed_closed_mu_aux phi2 0
unfold well_formed_closed in *.Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : svar H : well_formed_closed_mu_aux phi2 0 &&
well_formed_closed_ex_aux phi2 0 H0 : m > dbi
well_formed_closed_mu_aux phi2 0
destruct_and!. Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : svar H1 : well_formed_closed_mu_aux phi2 0 = true H2 : well_formed_closed_ex_aux phi2 0 = true H0 : m > dbi
well_formed_closed_mu_aux phi2 0
auto .
Qed .
Corollary evar_open_bevar_subst_higher m phi1 phi2 dbi X
: well_formed_closed_ex_aux phi2 0 ->
m < dbi ->
phi1^[evar : dbi ↦ phi2]^{evar : m ↦ X}
= phi1^{evar : m ↦ X}^[evar : pred dbi ↦ phi2].Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : evar
well_formed_closed_ex_aux phi2 0
→ m < dbi
→ phi1^[evar :dbi↦phi2]^{evar :m↦X} =
phi1^{evar :m↦X}^[evar :Init.Nat.pred dbi↦phi2]
Proof .Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : evar
well_formed_closed_ex_aux phi2 0
→ m < dbi
→ phi1^[evar :dbi↦phi2]^{evar :m↦X} =
phi1^{evar :m↦X}^[evar :Init.Nat.pred dbi↦phi2]
intros H H0.Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : evar H : well_formed_closed_ex_aux phi2 0 H0 : m < dbi
phi1^[evar :dbi↦phi2]^{evar :m↦X} =
phi1^{evar :m↦X}^[evar :Init.Nat.pred dbi↦phi2]
apply bevar_subst_comm_higher; auto .
Qed .
Corollary evar_open_bevar_subst_lower m phi1 phi2 dbi X
: well_formed_closed phi2 ->
m > dbi ->
phi1^[evar : dbi ↦ phi2]^{evar : m ↦ X}
= phi1^{evar : S m ↦ X}^[evar : dbi ↦ phi2].Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : evar
well_formed_closed phi2
→ m > dbi
→ phi1^[evar :dbi↦phi2]^{evar :m↦X} =
phi1^{evar :S m↦X}^[evar :dbi↦phi2]
Proof .Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : evar
well_formed_closed phi2
→ m > dbi
→ phi1^[evar :dbi↦phi2]^{evar :m↦X} =
phi1^{evar :S m↦X}^[evar :dbi↦phi2]
intros H H0.Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : evar H : well_formed_closed phi2 H0 : m > dbi
phi1^[evar :dbi↦phi2]^{evar :m↦X} =
phi1^{evar :S m↦X}^[evar :dbi↦phi2]
apply bevar_subst_comm_lower; auto .Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : evar H : well_formed_closed phi2 H0 : m > dbi
well_formed_closed_ex_aux phi2 0
unfold well_formed_closed in *.Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : evar H : well_formed_closed_mu_aux phi2 0 &&
well_formed_closed_ex_aux phi2 0 H0 : m > dbi
well_formed_closed_ex_aux phi2 0
destruct_and!. Σ : Signature m : nat phi1, phi2 : Pattern dbi : nat X : evar H1 : well_formed_closed_mu_aux phi2 0 = true H2 : well_formed_closed_ex_aux phi2 0 = true H0 : m > dbi
well_formed_closed_ex_aux phi2 0
auto .
Qed .
Lemma free_svars_bsvar_subst' :
forall φ ψ dbi X ,
(X ∈ free_svars (φ^[svar: dbi ↦ ψ])) <->
((X ∈ (free_svars ψ) /\ bsvar_occur φ dbi) \/ (X ∈ (free_svars φ))).Σ : Signature
∀ (φ ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ dbi
∨ X ∈ free_svars φ
Proof .Σ : Signature
∀ (φ ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ dbi
∨ X ∈ free_svars φ
induction φ; intros ψ dbi X; simpl .Σ : Signature x : evar ψ : Pattern dbi : db_index X : svar
X ∈ ∅ ↔ X ∈ free_svars ψ ∧ false ∨ X ∈ ∅
- Σ : Signature x : evar ψ : Pattern dbi : db_index X : svar
X ∈ ∅ ↔ X ∈ free_svars ψ ∧ false ∨ X ∈ ∅
split ; intros H; auto .Σ : Signature x : evar ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ false ∨ X ∈ ∅
X ∈ ∅
destruct H.Σ : Signature x : evar ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ false
X ∈ ∅
destruct H.Σ : Signature x : evar ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ H0 : false
X ∈ ∅
congruence .Σ : Signature x : evar ψ : Pattern dbi : db_index X : svar H : X ∈ ∅
X ∈ ∅
assumption .
- Σ : Signature x : svar ψ : Pattern dbi : db_index X : svar
X ∈ {[x]} ↔ X ∈ free_svars ψ ∧ false ∨ X ∈ {[x]}
split ; intros H; auto .Σ : Signature x : svar ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ false ∨ X ∈ {[x]}
X ∈ {[x]}
destruct H; auto .Σ : Signature x : svar ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ false
X ∈ {[x]}
destruct H; congruence .
- Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar
X ∈ ∅ ↔ X ∈ free_svars ψ ∧ false ∨ X ∈ ∅
split ; intros H; auto .Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ false ∨ X ∈ ∅
X ∈ ∅
destruct H; auto .Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ false
X ∈ ∅
destruct H; congruence .
- Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar
X
∈ free_svars
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ =>
patt_bound_svar (Nat.pred n)
end
↔ X ∈ free_svars ψ
∧ (if decide (n = dbi) then true else false) ∨ X ∈ ∅
case_match; split ; intros H'. Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H' : X ∈ free_svars (patt_bound_svar n)
X ∈ free_svars ψ
∧ (if decide (n = dbi) then true else false) ∨ X ∈ ∅
+ Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H' : X ∈ free_svars (patt_bound_svar n)
X ∈ free_svars ψ
∧ (if decide (n = dbi) then true else false) ∨ X ∈ ∅
simpl in H'.Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H' : X ∈ ∅
X ∈ free_svars ψ
∧ (if decide (n = dbi) then true else false) ∨ X ∈ ∅
set_solver.
+ Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H' : X ∈ free_svars ψ
∧ (if decide (n = dbi) then true else false)
∨ X ∈ ∅
X ∈ free_svars (patt_bound_svar n)
destruct H' as [H'|H'].Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H' : X ∈ free_svars ψ
∧ (if decide (n = dbi) then true else false)
X ∈ free_svars (patt_bound_svar n)
* Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H' : X ∈ free_svars ψ
∧ (if decide (n = dbi) then true else false)
X ∈ free_svars (patt_bound_svar n)
destruct H'; auto .Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H0 : X ∈ free_svars ψ H1 : if decide (n = dbi) then true else false
X ∈ free_svars (patt_bound_svar n)
case_match; auto ; subst . Σ : Signature ψ : Pattern dbi : db_index X : svar l : dbi < dbi H : compare_nat dbi dbi = Nat_less dbi dbi l H0 : X ∈ free_svars ψ H2 : decide (dbi = dbi) = left (erefl dbi) H1 : true
X ∈ free_svars (patt_bound_svar dbi)
lia .Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H0 : X ∈ free_svars ψ n0 : n ≠ dbi H2 : decide (n = dbi) = right n0 H1 : false
X ∈ free_svars (patt_bound_svar n)
congruence .
* Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H' : X ∈ ∅
X ∈ free_svars (patt_bound_svar n)
set_solver.
+ Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar e : n = dbi H : compare_nat n dbi = Nat_equal n dbi e H' : X ∈ free_svars ψ
X ∈ free_svars ψ
∧ (if decide (n = dbi) then true else false) ∨ X ∈ ∅
left .Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar e : n = dbi H : compare_nat n dbi = Nat_equal n dbi e H' : X ∈ free_svars ψ
X ∈ free_svars ψ
∧ (if decide (n = dbi) then true else false)
split ; auto .Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar e : n = dbi H : compare_nat n dbi = Nat_equal n dbi e H' : X ∈ free_svars ψ
if decide (n = dbi) then true else false
case_match; auto .
+ Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar e : n = dbi H : compare_nat n dbi = Nat_equal n dbi e H' : X ∈ free_svars ψ
∧ (if decide (n = dbi) then true else false)
∨ X ∈ ∅
X ∈ free_svars ψ
simpl in H.Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar e : n = dbi H : compare_nat n dbi = Nat_equal n dbi e H' : X ∈ free_svars ψ
∧ (if decide (n = dbi) then true else false)
∨ X ∈ ∅
X ∈ free_svars ψ
set_solver.
+ Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H' : X ∈ free_svars (patt_bound_svar (Nat.pred n))
X ∈ free_svars ψ
∧ (if decide (n = dbi) then true else false) ∨ X ∈ ∅
simpl in H.Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H' : X ∈ free_svars (patt_bound_svar (Nat.pred n))
X ∈ free_svars ψ
∧ (if decide (n = dbi) then true else false) ∨ X ∈ ∅
set_solver.
+ Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H' : X ∈ free_svars ψ
∧ (if decide (n = dbi) then true else false)
∨ X ∈ ∅
X ∈ free_svars (patt_bound_svar (Nat.pred n))
destruct H' as [H'|H'].Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H' : X ∈ free_svars ψ
∧ (if decide (n = dbi) then true else false)
X ∈ free_svars (patt_bound_svar (Nat.pred n))
* Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H' : X ∈ free_svars ψ
∧ (if decide (n = dbi) then true else false)
X ∈ free_svars (patt_bound_svar (Nat.pred n))
destruct H'.Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H0 : X ∈ free_svars ψ H1 : if decide (n = dbi) then true else false
X ∈ free_svars (patt_bound_svar (Nat.pred n))
case_match; try lia ; congruence .
* Σ : Signature n : db_index ψ : Pattern dbi : db_index X : svar g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H' : X ∈ ∅
X ∈ free_svars (patt_bound_svar (Nat.pred n))
set_solver.
- Σ : Signature sigma : symbols ψ : Pattern dbi : db_index X : svar
X ∈ ∅ ↔ X ∈ free_svars ψ ∧ false ∨ X ∈ ∅
split ; intros H'; auto .Σ : Signature sigma : symbols ψ : Pattern dbi : db_index X : svar H' : X ∈ free_svars ψ ∧ false ∨ X ∈ ∅
X ∈ ∅
destruct H' as [H'|H'].Σ : Signature sigma : symbols ψ : Pattern dbi : db_index X : svar H' : X ∈ free_svars ψ ∧ false
X ∈ ∅
+ Σ : Signature sigma : symbols ψ : Pattern dbi : db_index X : svar H' : X ∈ free_svars ψ ∧ false
X ∈ ∅
destruct H'.Σ : Signature sigma : symbols ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ H0 : false
X ∈ ∅
congruence .
+ Σ : Signature sigma : symbols ψ : Pattern dbi : db_index X : svar H' : X ∈ ∅
X ∈ ∅
set_solver.
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar
X
∈ free_svars φ1^[svar:dbi↦ψ]
∪ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∪ free_svars φ2
rewrite elem_of_union.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar
X ∈ free_svars φ1^[svar:dbi↦ψ]
∨ X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∪ free_svars φ2
rewrite elem_of_union.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar
X ∈ free_svars φ1^[svar:dbi↦ψ]
∨ X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
rewrite IHφ1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1) ∨ X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
rewrite IHφ2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
↔ X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
split ; intros H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : (X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
+ Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : (X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ H0 : bsvar_occur φ1 dbi
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
split ; auto .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ H0 : bsvar_occur φ1 dbi
bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
rewrite H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ H0 : bsvar_occur φ1 dbi
true || bsvar_occur φ2 dbi
auto .
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ1
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ1
X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ1
X ∈ free_svars φ1
assumption .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ H0 : bsvar_occur φ2 dbi
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
split ; auto .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ H0 : bsvar_occur φ2 dbi
bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
rewrite H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ H0 : bsvar_occur φ2 dbi
bsvar_occur φ1 dbi || true
apply orbT.
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ2
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ2
X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ2
X ∈ free_svars φ2
assumption .
+ Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
destruct H as [H1 H2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
destruct (decide (bsvar_occur φ1 dbi)).Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi i : bsvar_occur φ1 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi i : bsvar_occur φ1 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi i : bsvar_occur φ1 dbi
X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi i : bsvar_occur φ1 dbi
X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
split ; assumption .
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi n : ¬ bsvar_occur φ1 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
destruct (decide (bsvar_occur φ2 dbi)).Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi n : ¬ bsvar_occur φ1 dbi i : bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
2 : {Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi n : ¬ bsvar_occur φ1 dbi n0 : ¬ bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
apply orb_prop in H2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi = true
∨ bsvar_occur φ2 dbi = true n : ¬ bsvar_occur φ1 dbi n0 : ¬ bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
destruct H2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H : bsvar_occur φ1 dbi = true n : ¬ bsvar_occur φ1 dbi n0 : ¬ bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
rewrite H in n.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H : bsvar_occur φ1 dbi = true n0 : ¬ bsvar_occur φ2 dbi n : ¬ true
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
congruence .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H : bsvar_occur φ2 dbi = true n : ¬ bsvar_occur φ1 dbi n0 : ¬ bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
rewrite H in n0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H : bsvar_occur φ2 dbi = true n : ¬ bsvar_occur φ1 dbi n0 : ¬ true
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
congruence .
} Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi n : ¬ bsvar_occur φ1 dbi i : bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi n : ¬ bsvar_occur φ1 dbi i : bsvar_occur φ2 dbi
X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi n : ¬ bsvar_occur φ1 dbi i : bsvar_occur φ2 dbi
X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
split ; assumption .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ1
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ1
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ1
X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ1
X ∈ free_svars φ1
assumption .
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ2
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ2
X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ2
X ∈ free_svars φ2
assumption .
- Σ : Signature ψ : Pattern dbi : db_index X : svar
X ∈ ∅ ↔ X ∈ free_svars ψ ∧ false ∨ X ∈ ∅
split ; intros H; auto .Σ : Signature ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ false ∨ X ∈ ∅
X ∈ ∅
destruct H.Σ : Signature ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ false
X ∈ ∅
+ Σ : Signature ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ false
X ∈ ∅
destruct H.Σ : Signature ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ H0 : false
X ∈ ∅
congruence .
+ Σ : Signature ψ : Pattern dbi : db_index X : svar H : X ∈ ∅
X ∈ ∅
set_solver.
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar
X
∈ free_svars φ1^[svar:dbi↦ψ]
∪ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∪ free_svars φ2
rewrite elem_of_union.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar
X ∈ free_svars φ1^[svar:dbi↦ψ]
∨ X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∪ free_svars φ2
rewrite elem_of_union.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar
X ∈ free_svars φ1^[svar:dbi↦ψ]
∨ X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
rewrite IHφ1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1) ∨ X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
rewrite IHφ2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
↔ X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
split ; intros H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : (X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
+ Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : (X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ H0 : bsvar_occur φ1 dbi
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
split ; auto .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ H0 : bsvar_occur φ1 dbi
bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
rewrite H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ H0 : bsvar_occur φ1 dbi
true || bsvar_occur φ2 dbi
auto .
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ1
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ1
X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ1
X ∈ free_svars φ1
assumption .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ H0 : bsvar_occur φ2 dbi
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
split ; auto .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ H0 : bsvar_occur φ2 dbi
bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
rewrite H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ H0 : bsvar_occur φ2 dbi
bsvar_occur φ1 dbi || true
apply orbT.
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ2
X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ2
X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ2
X ∈ free_svars φ2
assumption .
+ Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
∨ X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars ψ
∧ bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
destruct H as [H1 H2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
destruct (decide (bsvar_occur φ1 dbi)).Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi i : bsvar_occur φ1 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi i : bsvar_occur φ1 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi i : bsvar_occur φ1 dbi
X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi i : bsvar_occur φ1 dbi
X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
split ; assumption .
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi n : ¬ bsvar_occur φ1 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
destruct (decide (bsvar_occur φ2 dbi)).Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi n : ¬ bsvar_occur φ1 dbi i : bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
2 : {Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi n : ¬ bsvar_occur φ1 dbi n0 : ¬ bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
apply orb_prop in H2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi = true
∨ bsvar_occur φ2 dbi = true n : ¬ bsvar_occur φ1 dbi n0 : ¬ bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
destruct H2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H : bsvar_occur φ1 dbi = true n : ¬ bsvar_occur φ1 dbi n0 : ¬ bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
rewrite H in n.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H : bsvar_occur φ1 dbi = true n0 : ¬ bsvar_occur φ2 dbi n : ¬ true
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
congruence .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H : bsvar_occur φ2 dbi = true n : ¬ bsvar_occur φ1 dbi n0 : ¬ bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
rewrite H in n0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H : bsvar_occur φ2 dbi = true n : ¬ bsvar_occur φ1 dbi n0 : ¬ true
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
congruence .
} Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi n : ¬ bsvar_occur φ1 dbi i : bsvar_occur φ2 dbi
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi n : ¬ bsvar_occur φ1 dbi i : bsvar_occur φ2 dbi
X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H1 : X ∈ free_svars ψ H2 : bsvar_occur φ1 dbi || bsvar_occur φ2 dbi n : ¬ bsvar_occur φ1 dbi i : bsvar_occur φ2 dbi
X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
split ; assumption .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ1 ∨ X ∈ free_svars φ2
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ1
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ1
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ1
X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ1
X ∈ free_svars φ1
assumption .
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ2
(X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1)
∨ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ2
X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ1^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ1 dbi
∨ X ∈ free_svars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ2^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ2 dbi
∨ X ∈ free_svars φ2ψ : Pattern dbi : db_index X : svar H : X ∈ free_svars φ2
X ∈ free_svars φ2
assumption .
- Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ dbi ∨ X ∈ free_svars φψ : Pattern dbi : db_index X : svar
X ∈ free_svars φ^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ dbi
∨ X ∈ free_svars φ
rewrite IHφ.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ dbi ∨ X ∈ free_svars φψ : Pattern dbi : db_index X : svar
X ∈ free_svars ψ ∧ bsvar_occur φ dbi
∨ X ∈ free_svars φ
↔ X ∈ free_svars ψ ∧ bsvar_occur φ dbi
∨ X ∈ free_svars φ
auto .
- Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ dbi ∨ X ∈ free_svars φψ : Pattern dbi : db_index X : svar
X ∈ free_svars φ^[svar:S dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ (S dbi)
∨ X ∈ free_svars φ
rewrite IHφ.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (dbi : db_index) (X : svar),
X ∈ free_svars φ^[svar:dbi↦ψ]
↔ X ∈ free_svars ψ ∧ bsvar_occur φ dbi ∨ X ∈ free_svars φψ : Pattern dbi : db_index X : svar
X ∈ free_svars ψ ∧ bsvar_occur φ (S dbi)
∨ X ∈ free_svars φ
↔ X ∈ free_svars ψ ∧ bsvar_occur φ (S dbi)
∨ X ∈ free_svars φ
auto .
Qed .
Lemma free_evars_bevar_subst' :
forall φ ψ dbi X ,
(X ∈ free_evars (φ^[evar : dbi ↦ ψ])) <->
((X ∈ (free_evars ψ) /\ bevar_occur φ dbi) \/ (X ∈ (free_evars φ))).Σ : Signature
∀ (φ ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ dbi
∨ X ∈ free_evars φ
Proof .Σ : Signature
∀ (φ ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ dbi
∨ X ∈ free_evars φ
induction φ; intros ψ dbi X; simpl .Σ : Signature x : evar ψ : Pattern dbi : db_index X : evar
X ∈ {[x]} ↔ X ∈ free_evars ψ ∧ false ∨ X ∈ {[x]}
- Σ : Signature x : evar ψ : Pattern dbi : db_index X : evar
X ∈ {[x]} ↔ X ∈ free_evars ψ ∧ false ∨ X ∈ {[x]}
split ; intros H; auto .Σ : Signature x : evar ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ false ∨ X ∈ {[x]}
X ∈ {[x]}
destruct H.Σ : Signature x : evar ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ false
X ∈ {[x]}
destruct H.Σ : Signature x : evar ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ H0 : false
X ∈ {[x]}
congruence .Σ : Signature x : evar ψ : Pattern dbi : db_index X : evar H : X ∈ {[x]}
X ∈ {[x]}
assumption .
- Σ : Signature x : svar ψ : Pattern dbi : db_index X : evar
X ∈ ∅ ↔ X ∈ free_evars ψ ∧ false ∨ X ∈ ∅
split ; intros H; auto .Σ : Signature x : svar ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ false ∨ X ∈ ∅
X ∈ ∅
destruct H; auto .Σ : Signature x : svar ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ false
X ∈ ∅
destruct H; congruence .
- Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar
X
∈ free_evars
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end
↔ X ∈ free_evars ψ
∧ (if decide (n = dbi) then true else false) ∨ X ∈ ∅
case_match; split ; intros H'. Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H' : X ∈ free_evars (patt_bound_evar n)
X ∈ free_evars ψ
∧ (if decide (n = dbi) then true else false) ∨ X ∈ ∅
+ Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H' : X ∈ free_evars (patt_bound_evar n)
X ∈ free_evars ψ
∧ (if decide (n = dbi) then true else false) ∨ X ∈ ∅
simpl in H'.Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H' : X ∈ ∅
X ∈ free_evars ψ
∧ (if decide (n = dbi) then true else false) ∨ X ∈ ∅
set_solver.
+ Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H' : X ∈ free_evars ψ
∧ (if decide (n = dbi) then true else false)
∨ X ∈ ∅
X ∈ free_evars (patt_bound_evar n)
destruct H' as [H'|H'].Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H' : X ∈ free_evars ψ
∧ (if decide (n = dbi) then true else false)
X ∈ free_evars (patt_bound_evar n)
* Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H' : X ∈ free_evars ψ
∧ (if decide (n = dbi) then true else false)
X ∈ free_evars (patt_bound_evar n)
destruct H'; auto .Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H0 : X ∈ free_evars ψ H1 : if decide (n = dbi) then true else false
X ∈ free_evars (patt_bound_evar n)
case_match; auto ; subst . Σ : Signature ψ : Pattern dbi : db_index X : evar l : dbi < dbi H : compare_nat dbi dbi = Nat_less dbi dbi l H0 : X ∈ free_evars ψ H2 : decide (dbi = dbi) = left (erefl dbi) H1 : true
X ∈ free_evars (patt_bound_evar dbi)
lia .Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H0 : X ∈ free_evars ψ n0 : n ≠ dbi H2 : decide (n = dbi) = right n0 H1 : false
X ∈ free_evars (patt_bound_evar n)
congruence .
* Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar l : n < dbi H : compare_nat n dbi = Nat_less n dbi l H' : X ∈ ∅
X ∈ free_evars (patt_bound_evar n)
set_solver.
+ Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar e : n = dbi H : compare_nat n dbi = Nat_equal n dbi e H' : X ∈ free_evars ψ
X ∈ free_evars ψ
∧ (if decide (n = dbi) then true else false) ∨ X ∈ ∅
left .Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar e : n = dbi H : compare_nat n dbi = Nat_equal n dbi e H' : X ∈ free_evars ψ
X ∈ free_evars ψ
∧ (if decide (n = dbi) then true else false)
split ; auto .Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar e : n = dbi H : compare_nat n dbi = Nat_equal n dbi e H' : X ∈ free_evars ψ
if decide (n = dbi) then true else false
case_match; auto .
+ Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar e : n = dbi H : compare_nat n dbi = Nat_equal n dbi e H' : X ∈ free_evars ψ
∧ (if decide (n = dbi) then true else false)
∨ X ∈ ∅
X ∈ free_evars ψ
simpl in H'.Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar e : n = dbi H : compare_nat n dbi = Nat_equal n dbi e H' : X ∈ free_evars ψ
∧ (if decide (n = dbi) then true else false)
∨ X ∈ ∅
X ∈ free_evars ψ
set_solver.
+ Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H' : X ∈ free_evars (patt_bound_evar (Nat.pred n))
X ∈ free_evars ψ
∧ (if decide (n = dbi) then true else false) ∨ X ∈ ∅
simpl in H'.Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H' : X ∈ ∅
X ∈ free_evars ψ
∧ (if decide (n = dbi) then true else false) ∨ X ∈ ∅
set_solver.
+ Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H' : X ∈ free_evars ψ
∧ (if decide (n = dbi) then true else false)
∨ X ∈ ∅
X ∈ free_evars (patt_bound_evar (Nat.pred n))
destruct H' as [H'|H'].Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H' : X ∈ free_evars ψ
∧ (if decide (n = dbi) then true else false)
X ∈ free_evars (patt_bound_evar (Nat.pred n))
* Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H' : X ∈ free_evars ψ
∧ (if decide (n = dbi) then true else false)
X ∈ free_evars (patt_bound_evar (Nat.pred n))
destruct H'.Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H0 : X ∈ free_evars ψ H1 : if decide (n = dbi) then true else false
X ∈ free_evars (patt_bound_evar (Nat.pred n))
case_match; try lia ; congruence .
* Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H' : X ∈ ∅
X ∈ free_evars (patt_bound_evar (Nat.pred n))
set_solver.
- Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar
X ∈ ∅ ↔ X ∈ free_evars ψ ∧ false ∨ X ∈ ∅
split ; intros H; auto .Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ false ∨ X ∈ ∅
X ∈ ∅
destruct H; auto .Σ : Signature n : db_index ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ false
X ∈ ∅
destruct H; congruence .
- Σ : Signature sigma : symbols ψ : Pattern dbi : db_index X : evar
X ∈ ∅ ↔ X ∈ free_evars ψ ∧ false ∨ X ∈ ∅
split ; intros H; auto .Σ : Signature sigma : symbols ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ false ∨ X ∈ ∅
X ∈ ∅
destruct H.Σ : Signature sigma : symbols ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ false
X ∈ ∅
+ Σ : Signature sigma : symbols ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ false
X ∈ ∅
destruct H.Σ : Signature sigma : symbols ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ H0 : false
X ∈ ∅
congruence .
+ Σ : Signature sigma : symbols ψ : Pattern dbi : db_index X : evar H : X ∈ ∅
X ∈ ∅
set_solver.
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar
X
∈ free_evars φ1^[evar :dbi↦ψ]
∪ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∪ free_evars φ2
rewrite elem_of_union.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar
X ∈ free_evars φ1^[evar :dbi↦ψ]
∨ X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∪ free_evars φ2
rewrite elem_of_union.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar
X ∈ free_evars φ1^[evar :dbi↦ψ]
∨ X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
rewrite IHφ1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1) ∨ X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
rewrite IHφ2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
↔ X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
split ; intros H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : (X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
+ Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : (X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ H0 : bevar_occur φ1 dbi
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
split ; auto .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ H0 : bevar_occur φ1 dbi
bevar_occur φ1 dbi || bevar_occur φ2 dbi
rewrite H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ H0 : bevar_occur φ1 dbi
true || bevar_occur φ2 dbi
auto .
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ1
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ1
X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ1
X ∈ free_evars φ1
assumption .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ H0 : bevar_occur φ2 dbi
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
split ; auto .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ H0 : bevar_occur φ2 dbi
bevar_occur φ1 dbi || bevar_occur φ2 dbi
rewrite H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ H0 : bevar_occur φ2 dbi
bevar_occur φ1 dbi || true
apply orbT.
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ2
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ2
X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ2
X ∈ free_evars φ2
assumption .
+ Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
destruct H as [H1 H2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
destruct (decide (bevar_occur φ1 dbi)).Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi i : bevar_occur φ1 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi i : bevar_occur φ1 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi i : bevar_occur φ1 dbi
X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi i : bevar_occur φ1 dbi
X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
split ; assumption .
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi n : ¬ bevar_occur φ1 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
destruct (decide (bevar_occur φ2 dbi)).Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi n : ¬ bevar_occur φ1 dbi i : bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
2 : {Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi n : ¬ bevar_occur φ1 dbi n0 : ¬ bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
apply orb_prop in H2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi = true
∨ bevar_occur φ2 dbi = true n : ¬ bevar_occur φ1 dbi n0 : ¬ bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
destruct H2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H : bevar_occur φ1 dbi = true n : ¬ bevar_occur φ1 dbi n0 : ¬ bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
rewrite H in n.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H : bevar_occur φ1 dbi = true n0 : ¬ bevar_occur φ2 dbi n : ¬ true
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
congruence .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H : bevar_occur φ2 dbi = true n : ¬ bevar_occur φ1 dbi n0 : ¬ bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
rewrite H in n0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H : bevar_occur φ2 dbi = true n : ¬ bevar_occur φ1 dbi n0 : ¬ true
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
congruence .
} Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi n : ¬ bevar_occur φ1 dbi i : bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi n : ¬ bevar_occur φ1 dbi i : bevar_occur φ2 dbi
X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi n : ¬ bevar_occur φ1 dbi i : bevar_occur φ2 dbi
X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
split ; assumption .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ1
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ1
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ1
X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ1
X ∈ free_evars φ1
assumption .
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ2
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ2
X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ2
X ∈ free_evars φ2
assumption .
- Σ : Signature ψ : Pattern dbi : db_index X : evar
X ∈ ∅ ↔ X ∈ free_evars ψ ∧ false ∨ X ∈ ∅
split ; intros H; auto .Σ : Signature ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ false ∨ X ∈ ∅
X ∈ ∅
destruct H.Σ : Signature ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ false
X ∈ ∅
+ Σ : Signature ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ false
X ∈ ∅
destruct H.Σ : Signature ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ H0 : false
X ∈ ∅
congruence .
+ Σ : Signature ψ : Pattern dbi : db_index X : evar H : X ∈ ∅
X ∈ ∅
set_solver.
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar
X
∈ free_evars φ1^[evar :dbi↦ψ]
∪ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∪ free_evars φ2
rewrite elem_of_union.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar
X ∈ free_evars φ1^[evar :dbi↦ψ]
∨ X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∪ free_evars φ2
rewrite elem_of_union.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar
X ∈ free_evars φ1^[evar :dbi↦ψ]
∨ X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
rewrite IHφ1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1) ∨ X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
rewrite IHφ2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
↔ X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
split ; intros H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : (X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
+ Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : (X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ H0 : bevar_occur φ1 dbi
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
split ; auto .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ H0 : bevar_occur φ1 dbi
bevar_occur φ1 dbi || bevar_occur φ2 dbi
rewrite H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ H0 : bevar_occur φ1 dbi
true || bevar_occur φ2 dbi
auto .
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ1
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ1
X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ1
X ∈ free_evars φ1
assumption .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ H0 : bevar_occur φ2 dbi
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
split ; auto .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ H0 : bevar_occur φ2 dbi
bevar_occur φ1 dbi || bevar_occur φ2 dbi
rewrite H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ H0 : bevar_occur φ2 dbi
bevar_occur φ1 dbi || true
apply orbT.
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ2
X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ2
X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ2
X ∈ free_evars φ2
assumption .
+ Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
∨ X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars ψ
∧ bevar_occur φ1 dbi || bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
destruct H as [H1 H2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
destruct (decide (bevar_occur φ1 dbi)).Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi i : bevar_occur φ1 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi i : bevar_occur φ1 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi i : bevar_occur φ1 dbi
X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi i : bevar_occur φ1 dbi
X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
split ; assumption .
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi n : ¬ bevar_occur φ1 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
destruct (decide (bevar_occur φ2 dbi)).Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi n : ¬ bevar_occur φ1 dbi i : bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
2 : {Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi n : ¬ bevar_occur φ1 dbi n0 : ¬ bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
apply orb_prop in H2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi = true
∨ bevar_occur φ2 dbi = true n : ¬ bevar_occur φ1 dbi n0 : ¬ bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
destruct H2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H : bevar_occur φ1 dbi = true n : ¬ bevar_occur φ1 dbi n0 : ¬ bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
rewrite H in n.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H : bevar_occur φ1 dbi = true n0 : ¬ bevar_occur φ2 dbi n : ¬ true
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
congruence .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H : bevar_occur φ2 dbi = true n : ¬ bevar_occur φ1 dbi n0 : ¬ bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
rewrite H in n0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H : bevar_occur φ2 dbi = true n : ¬ bevar_occur φ1 dbi n0 : ¬ true
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
congruence .
} Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi n : ¬ bevar_occur φ1 dbi i : bevar_occur φ2 dbi
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi n : ¬ bevar_occur φ1 dbi i : bevar_occur φ2 dbi
X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H1 : X ∈ free_evars ψ H2 : bevar_occur φ1 dbi || bevar_occur φ2 dbi n : ¬ bevar_occur φ1 dbi i : bevar_occur φ2 dbi
X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
split ; assumption .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ1 ∨ X ∈ free_evars φ2
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
destruct H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ1
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ1
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
left .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ1
X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ1
X ∈ free_evars φ1
assumption .
-- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ2
(X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1)
∨ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ2
X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2
right .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ1^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ1 dbi
∨ X ∈ free_evars φ1IHφ2 : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ2^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ2 dbi
∨ X ∈ free_evars φ2ψ : Pattern dbi : db_index X : evar H : X ∈ free_evars φ2
X ∈ free_evars φ2
assumption .
- Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ dbi ∨ X ∈ free_evars φψ : Pattern dbi : db_index X : evar
X ∈ free_evars φ^[evar :S dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ (S dbi)
∨ X ∈ free_evars φ
rewrite IHφ.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ dbi ∨ X ∈ free_evars φψ : Pattern dbi : db_index X : evar
X ∈ free_evars ψ ∧ bevar_occur φ (S dbi)
∨ X ∈ free_evars φ
↔ X ∈ free_evars ψ ∧ bevar_occur φ (S dbi)
∨ X ∈ free_evars φ
auto .
- Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ dbi ∨ X ∈ free_evars φψ : Pattern dbi : db_index X : evar
X ∈ free_evars φ^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ dbi
∨ X ∈ free_evars φ
rewrite IHφ.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (dbi : db_index) (X : evar ),
X ∈ free_evars φ^[evar :dbi↦ψ]
↔ X ∈ free_evars ψ ∧ bevar_occur φ dbi ∨ X ∈ free_evars φψ : Pattern dbi : db_index X : evar
X ∈ free_evars ψ ∧ bevar_occur φ dbi
∨ X ∈ free_evars φ
↔ X ∈ free_evars ψ ∧ bevar_occur φ dbi
∨ X ∈ free_evars φ
auto .
Qed .
Lemma free_svars_bsvar_subst :
forall φ ψ dbi ,
free_svars (φ^[svar: dbi ↦ ψ]) ⊆ union (free_svars ψ) (free_svars φ).Σ : Signature
∀ (φ ψ : Pattern) (dbi : db_index),
free_svars φ^[svar:dbi↦ψ]
⊆ free_svars ψ ∪ free_svars φ
Proof .Σ : Signature
∀ (φ ψ : Pattern) (dbi : db_index),
free_svars φ^[svar:dbi↦ψ]
⊆ free_svars ψ ∪ free_svars φ
induction φ; intros ψ dbi; simpl ; try set_solver.Σ : Signature n : db_index ψ : Pattern dbi : db_index
free_svars
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end ⊆ free_svars ψ ∪ ∅
case_match; simpl ; set_solver.
Qed .
Lemma free_evars_bevar_subst :
forall φ ψ dbi ,
free_evars (φ^[evar : dbi ↦ ψ]) ⊆ union (free_evars ψ) (free_evars φ).Σ : Signature
∀ (φ ψ : Pattern) (dbi : db_index),
free_evars φ^[evar :dbi↦ψ]
⊆ free_evars ψ ∪ free_evars φ
Proof .Σ : Signature
∀ (φ ψ : Pattern) (dbi : db_index),
free_evars φ^[evar :dbi↦ψ]
⊆ free_evars ψ ∪ free_evars φ
induction φ; intros ψ dbi Hwf; simpl ; try set_solver.Σ : Signature n : db_index ψ : Pattern dbi : db_index Hwf : evar
Hwf
∈ free_evars
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end → Hwf ∈ free_evars ψ ∪ ∅
case_match; simpl ; set_solver.
Qed .
Lemma free_svars_svar_open'' :
forall φ dbi X Y ,
(X ∈ free_svars (φ^{svar: dbi ↦ Y})) <->
(((X = Y) /\ (bsvar_occur φ dbi)) \/ (X ∈ (free_svars φ))).Σ : Signature
∀ (φ : Pattern) (dbi : db_index) (X Y : svar),
X ∈ free_svars φ^{svar:dbi↦Y}
↔ X = Y ∧ bsvar_occur φ dbi ∨ X ∈ free_svars φ
Proof .Σ : Signature
∀ (φ : Pattern) (dbi : db_index) (X Y : svar),
X ∈ free_svars φ^{svar:dbi↦Y}
↔ X = Y ∧ bsvar_occur φ dbi ∨ X ∈ free_svars φ
intros φ dbi X Y.Σ : Signature φ : Pattern dbi : db_index X, Y : svar
X ∈ free_svars φ^{svar:dbi↦Y}
↔ X = Y ∧ bsvar_occur φ dbi ∨ X ∈ free_svars φ
unfold svar_open.Σ : Signature φ : Pattern dbi : db_index X, Y : svar
X ∈ free_svars φ^[svar:dbi↦patt_free_svar Y]
↔ X = Y ∧ bsvar_occur φ dbi ∨ X ∈ free_svars φ
pose proof (Htmp := free_svars_bsvar_subst' φ (patt_free_svar Y) dbi X).Σ : Signature φ : Pattern dbi : db_index X, Y : svar Htmp : X ∈ free_svars φ^[svar:dbi↦patt_free_svar Y]
↔ X ∈ free_svars (patt_free_svar Y)
∧ bsvar_occur φ dbi ∨ X ∈ free_svars φ
X ∈ free_svars φ^[svar:dbi↦patt_free_svar Y]
↔ X = Y ∧ bsvar_occur φ dbi ∨ X ∈ free_svars φ
simpl in Htmp.Σ : Signature φ : Pattern dbi : db_index X, Y : svar Htmp : X ∈ free_svars φ^[svar:dbi↦patt_free_svar Y]
↔ X ∈ {[Y]} ∧ bsvar_occur φ dbi
∨ X ∈ free_svars φ
X ∈ free_svars φ^[svar:dbi↦patt_free_svar Y]
↔ X = Y ∧ bsvar_occur φ dbi ∨ X ∈ free_svars φ
assert (X ∈ @singleton _ SVarSet _ Y <-> X = Y) by set_solver.Σ : Signature φ : Pattern dbi : db_index X, Y : svar Htmp : X ∈ free_svars φ^[svar:dbi↦patt_free_svar Y]
↔ X ∈ {[Y]} ∧ bsvar_occur φ dbi
∨ X ∈ free_svars φ H : X ∈ {[Y]} ↔ X = Y
X ∈ free_svars φ^[svar:dbi↦patt_free_svar Y]
↔ X = Y ∧ bsvar_occur φ dbi ∨ X ∈ free_svars φ
tauto .
Qed .
Corollary free_svars_svar_open ϕ X dbi :
free_svars (ϕ^{svar: dbi ↦ X}) ⊆ union (singleton X) (free_svars ϕ).Σ : Signature ϕ : Pattern X : svar dbi : db_index
free_svars ϕ^{svar:dbi↦X} ⊆ {[X]} ∪ free_svars ϕ
Proof .Σ : Signature ϕ : Pattern X : svar dbi : db_index
free_svars ϕ^{svar:dbi↦X} ⊆ {[X]} ∪ free_svars ϕ
apply free_svars_bsvar_subst; auto .
Qed .
Lemma free_evars_evar_open'' :
forall φ dbi x y ,
(x ∈ free_evars (φ^{evar : dbi ↦ y})) <->
((x = y /\ bevar_occur φ dbi) \/ (x ∈ (free_evars φ))).Σ : Signature
∀ (φ : Pattern) (dbi : db_index) (x y : evar ),
x ∈ free_evars φ^{evar :dbi↦y}
↔ x = y ∧ bevar_occur φ dbi ∨ x ∈ free_evars φ
Proof .Σ : Signature
∀ (φ : Pattern) (dbi : db_index) (x y : evar ),
x ∈ free_evars φ^{evar :dbi↦y}
↔ x = y ∧ bevar_occur φ dbi ∨ x ∈ free_evars φ
intros φ dbi x y.Σ : Signature φ : Pattern dbi : db_index x, y : evar
x ∈ free_evars φ^{evar :dbi↦y}
↔ x = y ∧ bevar_occur φ dbi ∨ x ∈ free_evars φ
unfold evar_open.Σ : Signature φ : Pattern dbi : db_index x, y : evar
x ∈ free_evars φ^[evar :dbi↦patt_free_evar y]
↔ x = y ∧ bevar_occur φ dbi ∨ x ∈ free_evars φ
pose proof (Htmp := free_evars_bevar_subst' φ (patt_free_evar y) dbi x).Σ : Signature φ : Pattern dbi : db_index x, y : evar Htmp : x ∈ free_evars φ^[evar :dbi↦patt_free_evar y]
↔ x ∈ free_evars (patt_free_evar y)
∧ bevar_occur φ dbi ∨ x ∈ free_evars φ
x ∈ free_evars φ^[evar :dbi↦patt_free_evar y]
↔ x = y ∧ bevar_occur φ dbi ∨ x ∈ free_evars φ
simpl in Htmp.Σ : Signature φ : Pattern dbi : db_index x, y : evar Htmp : x ∈ free_evars φ^[evar :dbi↦patt_free_evar y]
↔ x ∈ {[y]} ∧ bevar_occur φ dbi
∨ x ∈ free_evars φ
x ∈ free_evars φ^[evar :dbi↦patt_free_evar y]
↔ x = y ∧ bevar_occur φ dbi ∨ x ∈ free_evars φ
assert (x ∈ @singleton _ EVarSet _ y <-> x = y) by set_solver;
tauto .
Qed .
Corollary free_evars_evar_open ϕ x dbi :
free_evars (ϕ^{evar : dbi ↦ x}) ⊆ union (singleton x) (free_evars ϕ).Σ : Signature ϕ : Pattern x : evar dbi : db_index
free_evars ϕ^{evar :dbi↦x} ⊆ {[x]} ∪ free_evars ϕ
Proof .Σ : Signature ϕ : Pattern x : evar dbi : db_index
free_evars ϕ^{evar :dbi↦x} ⊆ {[x]} ∪ free_evars ϕ
apply free_evars_bevar_subst; auto .
Qed .
Lemma free_evars_evar_open' ϕ x dbi :
free_evars ϕ ⊆ free_evars (ϕ^{evar : dbi ↦ x}).Σ : Signature ϕ : Pattern x : evar dbi : db_index
free_evars ϕ ⊆ free_evars ϕ^{evar :dbi↦x}
Proof .Σ : Signature ϕ : Pattern x : evar dbi : db_index
free_evars ϕ ⊆ free_evars ϕ^{evar :dbi↦x}
move : dbi.Σ : Signature ϕ : Pattern x : evar
∀ dbi : db_index,
free_evars ϕ ⊆ free_evars ϕ^{evar :dbi↦x}
induction ϕ; intros dbi; simpl ; try apply empty_subseteq.Σ : Signature x0, x : evar dbi : db_index
{[x0]} ⊆ {[x0]}
- Σ : Signature x0, x : evar dbi : db_index
{[x0]} ⊆ {[x0]}
apply PreOrder_Reflexive.
- Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ dbi : db_index,
free_evars ϕ1 ⊆ free_evars ϕ1^{evar :dbi↦x}IHϕ2 : ∀ dbi : db_index,
free_evars ϕ2 ⊆ free_evars ϕ2^{evar :dbi↦x}dbi : db_index
free_evars ϕ1 ∪ free_evars ϕ2
⊆ free_evars ϕ1^[evar :dbi↦patt_free_evar x]
∪ free_evars ϕ2^[evar :dbi↦patt_free_evar x]
apply union_least.Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ dbi : db_index,
free_evars ϕ1 ⊆ free_evars ϕ1^{evar :dbi↦x}IHϕ2 : ∀ dbi : db_index,
free_evars ϕ2 ⊆ free_evars ϕ2^{evar :dbi↦x}dbi : db_index
free_evars ϕ1
⊆ free_evars ϕ1^[evar :dbi↦patt_free_evar x]
∪ free_evars ϕ2^[evar :dbi↦patt_free_evar x]
+ Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ dbi : db_index,
free_evars ϕ1 ⊆ free_evars ϕ1^{evar :dbi↦x}IHϕ2 : ∀ dbi : db_index,
free_evars ϕ2 ⊆ free_evars ϕ2^{evar :dbi↦x}dbi : db_index
free_evars ϕ1
⊆ free_evars ϕ1^[evar :dbi↦patt_free_evar x]
∪ free_evars ϕ2^[evar :dbi↦patt_free_evar x]
eapply PreOrder_Transitive.Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ dbi : db_index,
free_evars ϕ1 ⊆ free_evars ϕ1^{evar :dbi↦x}IHϕ2 : ∀ dbi : db_index,
free_evars ϕ2 ⊆ free_evars ϕ2^{evar :dbi↦x}dbi : db_index
free_evars ϕ1 ⊆ ?y
apply IHϕ1.Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ dbi : db_index,
free_evars ϕ1 ⊆ free_evars ϕ1^{evar :dbi↦x}IHϕ2 : ∀ dbi : db_index,
free_evars ϕ2 ⊆ free_evars ϕ2^{evar :dbi↦x}dbi : db_index
free_evars ϕ1^{evar :?dbi ↦x}
⊆ free_evars ϕ1^[evar :dbi↦patt_free_evar x]
∪ free_evars ϕ2^[evar :dbi↦patt_free_evar x]
apply union_subseteq_l.
+ Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ dbi : db_index,
free_evars ϕ1 ⊆ free_evars ϕ1^{evar :dbi↦x}IHϕ2 : ∀ dbi : db_index,
free_evars ϕ2 ⊆ free_evars ϕ2^{evar :dbi↦x}dbi : db_index
free_evars ϕ2
⊆ free_evars ϕ1^[evar :dbi↦patt_free_evar x]
∪ free_evars ϕ2^[evar :dbi↦patt_free_evar x]
eapply PreOrder_Transitive.Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ dbi : db_index,
free_evars ϕ1 ⊆ free_evars ϕ1^{evar :dbi↦x}IHϕ2 : ∀ dbi : db_index,
free_evars ϕ2 ⊆ free_evars ϕ2^{evar :dbi↦x}dbi : db_index
free_evars ϕ2 ⊆ ?y
apply IHϕ2.Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ dbi : db_index,
free_evars ϕ1 ⊆ free_evars ϕ1^{evar :dbi↦x}IHϕ2 : ∀ dbi : db_index,
free_evars ϕ2 ⊆ free_evars ϕ2^{evar :dbi↦x}dbi : db_index
free_evars ϕ2^{evar :?dbi ↦x}
⊆ free_evars ϕ1^[evar :dbi↦patt_free_evar x]
∪ free_evars ϕ2^[evar :dbi↦patt_free_evar x]
apply union_subseteq_r.
- Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ dbi : db_index,
free_evars ϕ1 ⊆ free_evars ϕ1^{evar :dbi↦x}IHϕ2 : ∀ dbi : db_index,
free_evars ϕ2 ⊆ free_evars ϕ2^{evar :dbi↦x}dbi : db_index
free_evars ϕ1 ∪ free_evars ϕ2
⊆ free_evars ϕ1^[evar :dbi↦patt_free_evar x]
∪ free_evars ϕ2^[evar :dbi↦patt_free_evar x]
apply union_least.Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ dbi : db_index,
free_evars ϕ1 ⊆ free_evars ϕ1^{evar :dbi↦x}IHϕ2 : ∀ dbi : db_index,
free_evars ϕ2 ⊆ free_evars ϕ2^{evar :dbi↦x}dbi : db_index
free_evars ϕ1
⊆ free_evars ϕ1^[evar :dbi↦patt_free_evar x]
∪ free_evars ϕ2^[evar :dbi↦patt_free_evar x]
+ Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ dbi : db_index,
free_evars ϕ1 ⊆ free_evars ϕ1^{evar :dbi↦x}IHϕ2 : ∀ dbi : db_index,
free_evars ϕ2 ⊆ free_evars ϕ2^{evar :dbi↦x}dbi : db_index
free_evars ϕ1
⊆ free_evars ϕ1^[evar :dbi↦patt_free_evar x]
∪ free_evars ϕ2^[evar :dbi↦patt_free_evar x]
eapply PreOrder_Transitive.Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ dbi : db_index,
free_evars ϕ1 ⊆ free_evars ϕ1^{evar :dbi↦x}IHϕ2 : ∀ dbi : db_index,
free_evars ϕ2 ⊆ free_evars ϕ2^{evar :dbi↦x}dbi : db_index
free_evars ϕ1 ⊆ ?y
apply IHϕ1.Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ dbi : db_index,
free_evars ϕ1 ⊆ free_evars ϕ1^{evar :dbi↦x}IHϕ2 : ∀ dbi : db_index,
free_evars ϕ2 ⊆ free_evars ϕ2^{evar :dbi↦x}dbi : db_index
free_evars ϕ1^{evar :?dbi ↦x}
⊆ free_evars ϕ1^[evar :dbi↦patt_free_evar x]
∪ free_evars ϕ2^[evar :dbi↦patt_free_evar x]
apply union_subseteq_l.
+ Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ dbi : db_index,
free_evars ϕ1 ⊆ free_evars ϕ1^{evar :dbi↦x}IHϕ2 : ∀ dbi : db_index,
free_evars ϕ2 ⊆ free_evars ϕ2^{evar :dbi↦x}dbi : db_index
free_evars ϕ2
⊆ free_evars ϕ1^[evar :dbi↦patt_free_evar x]
∪ free_evars ϕ2^[evar :dbi↦patt_free_evar x]
eapply PreOrder_Transitive.Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ dbi : db_index,
free_evars ϕ1 ⊆ free_evars ϕ1^{evar :dbi↦x}IHϕ2 : ∀ dbi : db_index,
free_evars ϕ2 ⊆ free_evars ϕ2^{evar :dbi↦x}dbi : db_index
free_evars ϕ2 ⊆ ?y
apply IHϕ2.Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ dbi : db_index,
free_evars ϕ1 ⊆ free_evars ϕ1^{evar :dbi↦x}IHϕ2 : ∀ dbi : db_index,
free_evars ϕ2 ⊆ free_evars ϕ2^{evar :dbi↦x}dbi : db_index
free_evars ϕ2^{evar :?dbi ↦x}
⊆ free_evars ϕ1^[evar :dbi↦patt_free_evar x]
∪ free_evars ϕ2^[evar :dbi↦patt_free_evar x]
apply union_subseteq_r.
- Σ : Signature ϕ : Pattern x : evar IHϕ : ∀ dbi : db_index, free_evars ϕ ⊆ free_evars ϕ^{evar :dbi↦x}dbi : db_index
free_evars ϕ
⊆ free_evars ϕ^[evar :S dbi↦patt_free_evar x]
set_solver.
- Σ : Signature ϕ : Pattern x : evar IHϕ : ∀ dbi : db_index, free_evars ϕ ⊆ free_evars ϕ^{evar :dbi↦x}dbi : db_index
free_evars ϕ
⊆ free_evars ϕ^[evar :dbi↦patt_free_evar x]
set_solver.
Qed .
Lemma free_evar_subst_no_occurrence x p q :
x ∉ free_evars p ->
p^[[evar :x ↦ q]] = p.Σ : Signature x : evar p, q : Pattern
x ∉ free_evars p → p^[[evar :x↦q]] = p
Proof .Σ : Signature x : evar p, q : Pattern
x ∉ free_evars p → p^[[evar :x↦q]] = p
intros H.Σ : Signature x : evar p, q : Pattern H : x ∉ free_evars p
p^[[evar :x↦q]] = p
remember (size' p) as sz.Σ : Signature x : evar p, q : Pattern H : x ∉ free_evars p sz : nat Heqsz : sz = size' p
p^[[evar :x↦q]] = p
assert (Hsz: size' p <= sz) by lia .Σ : Signature x : evar p, q : Pattern H : x ∉ free_evars p sz : nat Heqsz : sz = size' p Hsz : size' p ≤ sz
p^[[evar :x↦q]] = p
clear Heqsz.Σ : Signature x : evar p, q : Pattern H : x ∉ free_evars p sz : nat Hsz : size' p ≤ sz
p^[[evar :x↦q]] = p
move : p Hsz H.Σ : Signature x : evar q : Pattern sz : nat
∀ p : Pattern,
size' p ≤ sz → x ∉ free_evars p → p^[[evar :x↦q]] = p
induction sz; intros p Hsz H; destruct p; simpl in *; try lia ; auto .Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = px0 : evar Hsz : 1 ≤ S szH : x ∉ {[x0]}
(if decide (x = x0) then q else patt_free_evar x0) =
patt_free_evar x0
- Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = px0 : evar Hsz : 1 ≤ S szH : x ∉ {[x0]}
(if decide (x = x0) then q else patt_free_evar x0) =
patt_free_evar x0
simpl in H.Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = px0 : evar Hsz : 1 ≤ S szH : x ∉ {[x0]}
(if decide (x = x0) then q else patt_free_evar x0) =
patt_free_evar x0
simpl .Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = px0 : evar Hsz : 1 ≤ S szH : x ∉ {[x0]}
(if decide (x = x0) then q else patt_free_evar x0) =
patt_free_evar x0
destruct (decide (x = x0)).Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = px0 : evar Hsz : 1 ≤ S szH : x ∉ {[x0]} e : x = x0
q = patt_free_evar x0
+ Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = px0 : evar Hsz : 1 ≤ S szH : x ∉ {[x0]} e : x = x0
q = patt_free_evar x0
subst x0.Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pHsz : 1 ≤ S szH : x ∉ {[x]}
q = patt_free_evar x
set_solver.
+ Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = px0 : evar Hsz : 1 ≤ S szH : x ∉ {[x0]} n : x ≠ x0
patt_free_evar x0 = patt_free_evar x0
reflexivity .
- Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp1, p2 : Pattern Hsz : S (size' p1 + size' p2) ≤ S sz H : x ∉ free_evars p1 ∪ free_evars p2
patt_app p1^[[evar :x↦q]] p2^[[evar :x↦q]] =
patt_app p1 p2
rewrite IHsz.Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp1, p2 : Pattern Hsz : S (size' p1 + size' p2) ≤ S sz H : x ∉ free_evars p1 ∪ free_evars p2
size' p1 ≤ sz
lia .Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp1, p2 : Pattern Hsz : S (size' p1 + size' p2) ≤ S sz H : x ∉ free_evars p1 ∪ free_evars p2
x ∉ free_evars p1
set_solver. Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp1, p2 : Pattern Hsz : S (size' p1 + size' p2) ≤ S sz H : x ∉ free_evars p1 ∪ free_evars p2
patt_app p1 p2^[[evar :x↦q]] = patt_app p1 p2
rewrite IHsz.Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp1, p2 : Pattern Hsz : S (size' p1 + size' p2) ≤ S sz H : x ∉ free_evars p1 ∪ free_evars p2
size' p2 ≤ sz
lia .Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp1, p2 : Pattern Hsz : S (size' p1 + size' p2) ≤ S sz H : x ∉ free_evars p1 ∪ free_evars p2
x ∉ free_evars p2
set_solver. Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp1, p2 : Pattern Hsz : S (size' p1 + size' p2) ≤ S sz H : x ∉ free_evars p1 ∪ free_evars p2
patt_app p1 p2 = patt_app p1 p2
reflexivity .
- Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp1, p2 : Pattern Hsz : S (size' p1 + size' p2) ≤ S sz H : x ∉ free_evars p1 ∪ free_evars p2
patt_imp p1^[[evar :x↦q]] p2^[[evar :x↦q]] =
patt_imp p1 p2
rewrite IHsz.Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp1, p2 : Pattern Hsz : S (size' p1 + size' p2) ≤ S sz H : x ∉ free_evars p1 ∪ free_evars p2
size' p1 ≤ sz
lia .Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp1, p2 : Pattern Hsz : S (size' p1 + size' p2) ≤ S sz H : x ∉ free_evars p1 ∪ free_evars p2
x ∉ free_evars p1
set_solver. Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp1, p2 : Pattern Hsz : S (size' p1 + size' p2) ≤ S sz H : x ∉ free_evars p1 ∪ free_evars p2
patt_imp p1 p2^[[evar :x↦q]] = patt_imp p1 p2
rewrite IHsz.Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp1, p2 : Pattern Hsz : S (size' p1 + size' p2) ≤ S sz H : x ∉ free_evars p1 ∪ free_evars p2
size' p2 ≤ sz
lia .Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp1, p2 : Pattern Hsz : S (size' p1 + size' p2) ≤ S sz H : x ∉ free_evars p1 ∪ free_evars p2
x ∉ free_evars p2
set_solver. Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp1, p2 : Pattern Hsz : S (size' p1 + size' p2) ≤ S sz H : x ∉ free_evars p1 ∪ free_evars p2
patt_imp p1 p2 = patt_imp p1 p2
reflexivity .
- Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp : Pattern Hsz : S (size' p) ≤ S sz H : x ∉ free_evars p
patt_exists p^[[evar :x↦q]] = patt_exists p
f_equal .Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp : Pattern Hsz : S (size' p) ≤ S sz H : x ∉ free_evars p
p^[[evar :x↦q]] = p
rewrite IHsz.Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp : Pattern Hsz : S (size' p) ≤ S sz H : x ∉ free_evars p
size' p ≤ sz
lia .Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp : Pattern Hsz : S (size' p) ≤ S sz H : x ∉ free_evars p
x ∉ free_evars p
exact H.Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp : Pattern Hsz : S (size' p) ≤ S sz H : x ∉ free_evars p
p = p
reflexivity .
- Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp : Pattern Hsz : S (size' p) ≤ S sz H : x ∉ free_evars p
patt_mu p^[[evar :x↦q]] = patt_mu p
rewrite IHsz; auto .Σ : Signature x : evar q : Pattern sz : nat IHsz : ∀ p : Pattern,
size' p ≤ sz
→ x ∉ free_evars p → p^[[evar :x↦q]] = pp : Pattern Hsz : S (size' p) ≤ S sz H : x ∉ free_evars p
size' p ≤ sz
lia .
Qed .
Lemma Private_bsvar_occur_evar_open sz dbi1 dbi2 X phi :
size phi <= sz ->
bsvar_occur phi dbi1 = false ->
bsvar_occur (phi^{evar : dbi2 ↦ X}) dbi1 = false.Σ : Signature sz : nat dbi1, dbi2 : db_index X : evar phi : Pattern
size phi ≤ sz
→ bsvar_occur phi dbi1 = false
→ bsvar_occur phi^{evar :dbi2↦X} dbi1 = false
Proof .Σ : Signature sz : nat dbi1, dbi2 : db_index X : evar phi : Pattern
size phi ≤ sz
→ bsvar_occur phi dbi1 = false
→ bsvar_occur phi^{evar :dbi2↦X} dbi1 = false
move : phi dbi1 dbi2.Σ : Signature sz : nat X : evar
∀ (phi : Pattern) (dbi1 dbi2 : db_index),
size phi ≤ sz
→ bsvar_occur phi dbi1 = false
→ bsvar_occur phi^{evar :dbi2↦X} dbi1 = false
induction sz; move => phi; destruct phi; simpl ; move => dbi1 dbi2 Hsz H; try rewrite !IHsz; auto ; try lia ; try apply orb_false_elim in H; firstorder .Σ : Signature X : evar n, dbi1, dbi2 : db_index Hsz : 0 ≤ 0 H : false = false
bsvar_occur (patt_bound_evar n)^{evar :dbi2↦X} dbi1 =
false
2 : {Σ : Signature sz : nat X : evar IHsz : ∀ (phi : Pattern) (dbi1 dbi2 : db_index),
size phi ≤ sz
→ bsvar_occur phi dbi1 = false
→ bsvar_occur phi^{evar :dbi2↦X} dbi1 =
falsen, dbi1, dbi2 : db_index Hsz : 0 ≤ S szH : false = false
size (patt_bound_evar n) ≤ sz
simpl .Σ : Signature sz : nat X : evar IHsz : ∀ (phi : Pattern) (dbi1 dbi2 : db_index),
size phi ≤ sz
→ bsvar_occur phi dbi1 = false
→ bsvar_occur phi^{evar :dbi2↦X} dbi1 =
falsen, dbi1, dbi2 : db_index Hsz : 0 ≤ S szH : false = false
0 ≤ sz
lia . } Σ : Signature X : evar n, dbi1, dbi2 : db_index Hsz : 0 ≤ 0 H : false = false
bsvar_occur (patt_bound_evar n)^{evar :dbi2↦X} dbi1 =
false
cbn .Σ : Signature X : evar n, dbi1, dbi2 : db_index Hsz : 0 ≤ 0 H : false = false
bsvar_occur
match compare_nat n dbi2 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar X
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end dbi1 = false
case_match; reflexivity .
Qed .
Corollary bsvar_occur_evar_open dbi1 dbi2 X phi :
bsvar_occur phi dbi1 = false ->
bsvar_occur (phi^{evar : dbi2 ↦ X}) dbi1 = false.Σ : Signature dbi1, dbi2 : db_index X : evar phi : Pattern
bsvar_occur phi dbi1 = false
→ bsvar_occur phi^{evar :dbi2↦X} dbi1 = false
Proof .Σ : Signature dbi1, dbi2 : db_index X : evar phi : Pattern
bsvar_occur phi dbi1 = false
→ bsvar_occur phi^{evar :dbi2↦X} dbi1 = false
apply Private_bsvar_occur_evar_open with (sz := size phi).Σ : Signature dbi1, dbi2 : db_index X : evar phi : Pattern
size phi ≤ size phi
lia .
Qed .
Lemma Private_bevar_occur_svar_open sz dbi1 dbi2 X phi :
size phi <= sz ->
bevar_occur phi dbi1 = false ->
bevar_occur (phi^{svar: dbi2 ↦ X}) dbi1 = false.Σ : Signature sz : nat dbi1, dbi2 : db_index X : svar phi : Pattern
size phi ≤ sz
→ bevar_occur phi dbi1 = false
→ bevar_occur phi^{svar:dbi2↦X} dbi1 = false
Proof .Σ : Signature sz : nat dbi1, dbi2 : db_index X : svar phi : Pattern
size phi ≤ sz
→ bevar_occur phi dbi1 = false
→ bevar_occur phi^{svar:dbi2↦X} dbi1 = false
move : phi dbi1 dbi2.Σ : Signature sz : nat X : svar
∀ (phi : Pattern) (dbi1 dbi2 : db_index),
size phi ≤ sz
→ bevar_occur phi dbi1 = false
→ bevar_occur phi^{svar:dbi2↦X} dbi1 = false
induction sz; move => phi; destruct phi; simpl ; move => dbi1 dbi2 Hsz H; try rewrite !IHsz; auto ; try lia ; try apply orb_false_elim in H; firstorder .Σ : Signature X : svar n, dbi1, dbi2 : db_index Hsz : 0 ≤ 0 H : false = false
bevar_occur (patt_bound_svar n)^{svar:dbi2↦X} dbi1 =
false
{ Σ : Signature X : svar n, dbi1, dbi2 : db_index Hsz : 0 ≤ 0 H : false = false
bevar_occur (patt_bound_svar n)^{svar:dbi2↦X} dbi1 =
false
cbn .Σ : Signature X : svar n, dbi1, dbi2 : db_index Hsz : 0 ≤ 0 H : false = false
bevar_occur
match compare_nat n dbi2 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar X
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end dbi1 = false
case_match; reflexivity . } Σ : Signature sz : nat X : svar IHsz : ∀ (phi : Pattern) (dbi1 dbi2 : db_index),
size phi ≤ sz
→ bevar_occur phi dbi1 = false
→ bevar_occur phi^{svar:dbi2↦X} dbi1 =
falsen, dbi1, dbi2 : db_index Hsz : 0 ≤ S szH : false = false
size (patt_bound_svar n) ≤ sz
simpl .Σ : Signature sz : nat X : svar IHsz : ∀ (phi : Pattern) (dbi1 dbi2 : db_index),
size phi ≤ sz
→ bevar_occur phi dbi1 = false
→ bevar_occur phi^{svar:dbi2↦X} dbi1 =
falsen, dbi1, dbi2 : db_index Hsz : 0 ≤ S szH : false = false
0 ≤ sz
lia .
Qed .
Corollary bevar_occur_svar_open dbi1 dbi2 X phi :
bevar_occur phi dbi1 = false ->
bevar_occur (phi^{svar: dbi2 ↦ X}) dbi1 = false.Σ : Signature dbi1, dbi2 : db_index X : svar phi : Pattern
bevar_occur phi dbi1 = false
→ bevar_occur phi^{svar:dbi2↦X} dbi1 = false
Proof .Σ : Signature dbi1, dbi2 : db_index X : svar phi : Pattern
bevar_occur phi dbi1 = false
→ bevar_occur phi^{svar:dbi2↦X} dbi1 = false
apply Private_bevar_occur_svar_open with (sz := size phi).Σ : Signature dbi1, dbi2 : db_index X : svar phi : Pattern
size phi ≤ size phi
lia .
Qed .
Lemma Private_bevar_occur_evar_open sz dbi1 dbi2 X phi :
size phi <= sz -> dbi1 < dbi2 ->
bevar_occur phi dbi1 = false ->
bevar_occur (phi^{evar : dbi2 ↦ X}) dbi1 = false.Σ : Signature sz, dbi1, dbi2 : nat X : evar phi : Pattern
size phi ≤ sz
→ dbi1 < dbi2
→ bevar_occur phi dbi1 = false
→ bevar_occur phi^{evar :dbi2↦X} dbi1 = false
Proof .Σ : Signature sz, dbi1, dbi2 : nat X : evar phi : Pattern
size phi ≤ sz
→ dbi1 < dbi2
→ bevar_occur phi dbi1 = false
→ bevar_occur phi^{evar :dbi2↦X} dbi1 = false
move : phi dbi1 dbi2.Σ : Signature sz : nat X : evar
∀ (phi : Pattern) (dbi1 dbi2 : nat),
size phi ≤ sz
→ dbi1 < dbi2
→ bevar_occur phi dbi1 = false
→ bevar_occur phi^{evar :dbi2↦X} dbi1 = false
induction sz; move => phi; destruct phi; simpl ; move => dbi1 dbi2 Hsz H H1; try rewrite !IHsz; auto ; try lia ; try apply orb_false_elim in H1; firstorder .Σ : Signature X : evar n : db_index dbi1, dbi2 : nat Hsz : 0 ≤ 0 H : dbi1 < dbi2 H1 : (if decide (n = dbi1) then true else false) =
false
bevar_occur (patt_bound_evar n)^{evar :dbi2↦X} dbi1 =
false
{ Σ : Signature X : evar n : db_index dbi1, dbi2 : nat Hsz : 0 ≤ 0 H : dbi1 < dbi2 H1 : (if decide (n = dbi1) then true else false) =
false
bevar_occur (patt_bound_evar n)^{evar :dbi2↦X} dbi1 =
false
cbn .Σ : Signature X : evar n : db_index dbi1, dbi2 : nat Hsz : 0 ≤ 0 H : dbi1 < dbi2 H1 : (if decide (n = dbi1) then true else false) =
false
bevar_occur
match compare_nat n dbi2 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar X
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end dbi1 = false
repeat case_match; simpl ; auto ; try lia .Σ : Signature X : evar n : db_index dbi1, dbi2 : nat Hsz : 0 ≤ 0 H : dbi1 < dbi2 n0 : n ≠ dbi1 H0 : decide (n = dbi1) = right n0 H1 : false = false l : n < dbi2 H2 : compare_nat n dbi2 = Nat_less n dbi2 l
(if decide (n = dbi1) then true else false) = false
{ Σ : Signature X : evar n : db_index dbi1, dbi2 : nat Hsz : 0 ≤ 0 H : dbi1 < dbi2 n0 : n ≠ dbi1 H0 : decide (n = dbi1) = right n0 H1 : false = false l : n < dbi2 H2 : compare_nat n dbi2 = Nat_less n dbi2 l
(if decide (n = dbi1) then true else false) = false
rewrite H0.Σ : Signature X : evar n : db_index dbi1, dbi2 : nat Hsz : 0 ≤ 0 H : dbi1 < dbi2 n0 : n ≠ dbi1 H0 : decide (n = dbi1) = right n0 H1 : false = false l : n < dbi2 H2 : compare_nat n dbi2 = Nat_less n dbi2 l
false = false
reflexivity . } Σ : Signature X : evar n : db_index dbi1, dbi2 : nat Hsz : 0 ≤ 0 H : dbi1 < dbi2 n0 : n ≠ dbi1 H0 : decide (n = dbi1) = right n0 H1 : false = false g : n > dbi2 H2 : compare_nat n dbi2 = Nat_greater n dbi2 g
(if decide (Nat.pred n = dbi1) then true else false) =
false
{ Σ : Signature X : evar n : db_index dbi1, dbi2 : nat Hsz : 0 ≤ 0 H : dbi1 < dbi2 n0 : n ≠ dbi1 H0 : decide (n = dbi1) = right n0 H1 : false = false g : n > dbi2 H2 : compare_nat n dbi2 = Nat_greater n dbi2 g
(if decide (Nat.pred n = dbi1) then true else false) =
false
case_match; try lia . }
} Σ : Signature sz : nat X : evar IHsz : ∀ (phi : Pattern) (dbi1 dbi2 : nat),
size phi ≤ sz
→ dbi1 < dbi2
→ bevar_occur phi dbi1 = false
→ bevar_occur phi^{evar :dbi2↦X} dbi1 =
falsen : db_index dbi1, dbi2 : nat Hsz : 0 ≤ S szH : dbi1 < dbi2 H1 : (if decide (n = dbi1) then true else false) =
false
size (patt_bound_evar n) ≤ sz
simpl .Σ : Signature sz : nat X : evar IHsz : ∀ (phi : Pattern) (dbi1 dbi2 : nat),
size phi ≤ sz
→ dbi1 < dbi2
→ bevar_occur phi dbi1 = false
→ bevar_occur phi^{evar :dbi2↦X} dbi1 =
falsen : db_index dbi1, dbi2 : nat Hsz : 0 ≤ S szH : dbi1 < dbi2 H1 : (if decide (n = dbi1) then true else false) =
false
0 ≤ sz
lia .
Qed .
Corollary bevar_occur_evar_open dbi1 dbi2 X phi :
bevar_occur phi dbi1 = false -> dbi1 < dbi2 ->
bevar_occur (phi^{evar : dbi2 ↦ X}) dbi1 = false.Σ : Signature dbi1 : db_index dbi2 : nat X : evar phi : Pattern
bevar_occur phi dbi1 = false
→ dbi1 < dbi2
→ bevar_occur phi^{evar :dbi2↦X} dbi1 = false
Proof .Σ : Signature dbi1 : db_index dbi2 : nat X : evar phi : Pattern
bevar_occur phi dbi1 = false
→ dbi1 < dbi2
→ bevar_occur phi^{evar :dbi2↦X} dbi1 = false
intros H H0.Σ : Signature dbi1 : db_index dbi2 : nat X : evar phi : Pattern H : bevar_occur phi dbi1 = false H0 : dbi1 < dbi2
bevar_occur phi^{evar :dbi2↦X} dbi1 = false
apply Private_bevar_occur_evar_open with (sz := size phi); auto .
Qed .
Lemma well_formed_positive_bevar_subst φ : forall n ψ ,
mu_free φ ->
well_formed_positive φ = true -> well_formed_positive ψ = true
->
well_formed_positive (φ^[evar : n ↦ ψ]) = true.Σ : Signature φ : Pattern
∀ (n : db_index) (ψ : Pattern),
mu_free φ
→ well_formed_positive φ = true
→ well_formed_positive ψ = true
→ well_formed_positive φ^[evar :n↦ψ] = true
Proof .Σ : Signature φ : Pattern
∀ (n : db_index) (ψ : Pattern),
mu_free φ
→ well_formed_positive φ = true
→ well_formed_positive ψ = true
→ well_formed_positive φ^[evar :n↦ψ] = true
induction φ; intros n' ψ H H0 H1; simpl ; auto .Σ : Signature n, n' : db_index ψ : Pattern H : mu_free (patt_bound_evar n) H0 : well_formed_positive (patt_bound_evar n) = true H1 : well_formed_positive ψ = true
well_formed_positive
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = true
2 -3 : apply andb_true_iff in H as [E1 E2];
simpl in H0; apply eq_sym, andb_true_eq in H0; destruct H0;
rewrite -> IHφ1, -> IHφ2; auto .Σ : Signature n, n' : db_index ψ : Pattern H : mu_free (patt_bound_evar n) H0 : well_formed_positive (patt_bound_evar n) = true H1 : well_formed_positive ψ = true
well_formed_positive
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = true
* Σ : Signature n, n' : db_index ψ : Pattern H : mu_free (patt_bound_evar n) H0 : well_formed_positive (patt_bound_evar n) = true H1 : well_formed_positive ψ = true
well_formed_positive
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = true
break_match_goal; auto .
Qed .
Lemma mu_free_bevar_subst :
forall φ ψ , mu_free φ -> mu_free ψ -> forall n , mu_free (φ^[evar : n ↦ ψ]).Σ : Signature
∀ φ ψ : Pattern,
mu_free φ
→ mu_free ψ → ∀ n : db_index, mu_free φ^[evar :n↦ψ]
Proof .Σ : Signature
∀ φ ψ : Pattern,
mu_free φ
→ mu_free ψ → ∀ n : db_index, mu_free φ^[evar :n↦ψ]
induction φ; intros ψ H H0 n'; simpl ; try now constructor .Σ : Signature n : db_index ψ : Pattern H : mu_free (patt_bound_evar n) H0 : mu_free ψ n' : db_index
mu_free
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end
* Σ : Signature n : db_index ψ : Pattern H : mu_free (patt_bound_evar n) H0 : mu_free ψ n' : db_index
mu_free
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end
break_match_goal; auto .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ ψ : Pattern,
mu_free φ1
→ mu_free ψ
→ ∀ n : db_index, mu_free φ1^[evar :n↦ψ]IHφ2 : ∀ ψ : Pattern,
mu_free φ2
→ mu_free ψ
→ ∀ n : db_index, mu_free φ2^[evar :n↦ψ]ψ : Pattern H : mu_free (patt_app φ1 φ2) H0 : mu_free ψ n' : db_index
mu_free φ1^[evar :n'↦ψ] && mu_free φ2^[evar :n'↦ψ]
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ ψ : Pattern,
mu_free φ1
→ mu_free ψ
→ ∀ n : db_index, mu_free φ1^[evar :n↦ψ]IHφ2 : ∀ ψ : Pattern,
mu_free φ2
→ mu_free ψ
→ ∀ n : db_index, mu_free φ2^[evar :n↦ψ]ψ : Pattern H : mu_free φ1 && mu_free φ2 H0 : mu_free ψ n' : db_index
mu_free φ1^[evar :n'↦ψ] && mu_free φ2^[evar :n'↦ψ]
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ ψ : Pattern,
mu_free φ1
→ mu_free ψ
→ ∀ n : db_index, mu_free φ1^[evar :n↦ψ]IHφ2 : ∀ ψ : Pattern,
mu_free φ2
→ mu_free ψ
→ ∀ n : db_index, mu_free φ2^[evar :n↦ψ]ψ : Pattern E1 : mu_free φ1 = true E2 : mu_free φ2 = true H0 : mu_free ψ n' : db_index
mu_free φ1^[evar :n'↦ψ] && mu_free φ2^[evar :n'↦ψ]
now rewrite -> IHφ1, -> IHφ2.
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ ψ : Pattern,
mu_free φ1
→ mu_free ψ
→ ∀ n : db_index, mu_free φ1^[evar :n↦ψ]IHφ2 : ∀ ψ : Pattern,
mu_free φ2
→ mu_free ψ
→ ∀ n : db_index, mu_free φ2^[evar :n↦ψ]ψ : Pattern H : mu_free (patt_imp φ1 φ2) H0 : mu_free ψ n' : db_index
mu_free φ1^[evar :n'↦ψ] && mu_free φ2^[evar :n'↦ψ]
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ ψ : Pattern,
mu_free φ1
→ mu_free ψ
→ ∀ n : db_index, mu_free φ1^[evar :n↦ψ]IHφ2 : ∀ ψ : Pattern,
mu_free φ2
→ mu_free ψ
→ ∀ n : db_index, mu_free φ2^[evar :n↦ψ]ψ : Pattern H : mu_free φ1 && mu_free φ2 H0 : mu_free ψ n' : db_index
mu_free φ1^[evar :n'↦ψ] && mu_free φ2^[evar :n'↦ψ]
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ ψ : Pattern,
mu_free φ1
→ mu_free ψ
→ ∀ n : db_index, mu_free φ1^[evar :n↦ψ]IHφ2 : ∀ ψ : Pattern,
mu_free φ2
→ mu_free ψ
→ ∀ n : db_index, mu_free φ2^[evar :n↦ψ]ψ : Pattern E1 : mu_free φ1 = true E2 : mu_free φ2 = true H0 : mu_free ψ n' : db_index
mu_free φ1^[evar :n'↦ψ] && mu_free φ2^[evar :n'↦ψ]
now rewrite -> IHφ1, -> IHφ2.
* Σ : Signature φ : Pattern IHφ : ∀ ψ : Pattern, mu_free φ → mu_free ψ → ∀ n : db_index, mu_free φ^[evar :n↦ψ]ψ : Pattern H : mu_free (patt_exists φ) H0 : mu_free ψ n' : db_index
mu_free φ^[evar :S n'↦ψ]
simpl in H.Σ : Signature φ : Pattern IHφ : ∀ ψ : Pattern, mu_free φ → mu_free ψ → ∀ n : db_index, mu_free φ^[evar :n↦ψ]ψ : Pattern H : mu_free φ H0 : mu_free ψ n' : db_index
mu_free φ^[evar :S n'↦ψ]
now apply IHφ.
* Σ : Signature φ : Pattern IHφ : ∀ ψ : Pattern, mu_free φ → mu_free ψ → ∀ n : db_index, mu_free φ^[evar :n↦ψ]ψ : Pattern H : mu_free (patt_mu φ) H0 : mu_free ψ n' : db_index
false
inversion H.
Qed .
Corollary mu_free_evar_open :
forall φ , mu_free φ -> forall x n , mu_free (φ^{evar : n ↦ x}).Σ : Signature
∀ φ : Pattern,
mu_free φ
→ ∀ (x : evar ) (n : db_index), mu_free φ^{evar :n↦x}
Proof .Σ : Signature
∀ φ : Pattern,
mu_free φ
→ ∀ (x : evar ) (n : db_index), mu_free φ^{evar :n↦x}
intros φ H x n.Σ : Signature φ : Pattern H : mu_free φ x : evar n : db_index
mu_free φ^{evar :n↦x}
apply mu_free_bevar_subst; auto .
Qed .
Theorem evar_open_free_evar_subst_swap :
forall φ x n ψ y , x <> y -> well_formed ψ ->
φ^[[evar : y ↦ ψ]]^{evar : n ↦ x} = φ^{evar : n ↦ x}^[[evar : y ↦ ψ]].Σ : Signature
∀ (φ : Pattern) (x : evar ) (n : db_index) (ψ : Pattern)
(y : evar ),
x ≠ y
→ well_formed ψ
→ φ^[[evar :y↦ψ]]^{evar :n↦x} =
φ^{evar :n↦x}^[[evar :y↦ψ]]
Proof .Σ : Signature
∀ (φ : Pattern) (x : evar ) (n : db_index) (ψ : Pattern)
(y : evar ),
x ≠ y
→ well_formed ψ
→ φ^[[evar :y↦ψ]]^{evar :n↦x} =
φ^{evar :n↦x}^[[evar :y↦ψ]]
induction φ; intros x' n' ψ y H H0; simpl ; auto .Σ : Signature x, x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ
(if decide (y = x) then ψ else patt_free_evar x)^{evar :n'↦x'} =
(if decide (y = x) then ψ else patt_free_evar x)
* Σ : Signature x, x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ
(if decide (y = x) then ψ else patt_free_evar x)^{evar :n'↦x'} =
(if decide (y = x) then ψ else patt_free_evar x)
destruct (decide (y = x)); simpl .Σ : Signature x, x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ e : y = x
ψ^{evar :n'↦x'} = ψ
** Σ : Signature x, x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ e : y = x
ψ^{evar :n'↦x'} = ψ
rewrite evar_open_wfc; auto .Σ : Signature x, x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ e : y = x
well_formed_closed_ex_aux ψ 0
unfold well_formed,well_formed_closed in H0.Σ : Signature x, x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : [&& well_formed_positive ψ,
well_formed_closed_mu_aux ψ 0
& well_formed_closed_ex_aux ψ 0 ] e : y = x
well_formed_closed_ex_aux ψ 0
destruct_and!. Σ : Signature x, x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H1 : well_formed_positive ψ = true H0 : well_formed_closed_mu_aux ψ 0 = true H3 : well_formed_closed_ex_aux ψ 0 = true e : y = x
well_formed_closed_ex_aux ψ 0
assumption .
** Σ : Signature x, x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ n : y ≠ x
(patt_free_evar x)^{evar :n'↦x'} = patt_free_evar x
reflexivity .
* Σ : Signature n : db_index x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ
(patt_bound_evar n)^{evar :n'↦x'} =
(patt_bound_evar n)^{evar :n'↦x'}^[[evar :y↦ψ]]
cbn .Σ : Signature n : db_index x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x'
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end =
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x'
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end ^[[evar :y↦ψ]]
break_match_goal; simpl ; auto . Σ : Signature n : db_index x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ e : n = n' Heqc : compare_nat n n' = Nat_equal n n' e
patt_free_evar x' =
(if decide (y = x') then ψ else patt_free_evar x')
destruct (decide (y = x')); auto .Σ : Signature n : db_index x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ e : n = n' Heqc : compare_nat n n' = Nat_equal n n' e e0 : y = x'
patt_free_evar x' = ψ
congruence .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index)
(ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ
→ φ1^[[evar :y↦ψ]]^{evar :n↦x} =
φ1^{evar :n↦x}^[[evar :y↦ψ]]IHφ2 : ∀ (x : evar ) (n : db_index)
(ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ
→ φ2^[[evar :y↦ψ]]^{evar :n↦x} =
φ2^{evar :n↦x}^[[evar :y↦ψ]]x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ
(patt_app φ1^[[evar :y↦ψ]] φ2^[[evar :y↦ψ]])^{evar :n'↦x'} =
patt_app φ1^[evar :n'↦patt_free_evar x']^[[evar :y↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :y↦ψ]]
unfold evar_open in *.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index)
(ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ
→ φ1^[[evar :y↦ψ]]^[evar :n↦
patt_free_evar x] =
φ1^[evar :n↦patt_free_evar x]^[[evar :y↦ψ]]IHφ2 : ∀ (x : evar ) (n : db_index)
(ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ
→ φ2^[[evar :y↦ψ]]^[evar :n↦
patt_free_evar x] =
φ2^[evar :n↦patt_free_evar x]^[[evar :y↦ψ]]x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ
(patt_app φ1^[[evar :y↦ψ]] φ2^[[evar :y↦ψ]])^[evar :n'↦
patt_free_evar x'] =
patt_app φ1^[evar :n'↦patt_free_evar x']^[[evar :y↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :y↦ψ]]
simpl .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index)
(ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ
→ φ1^[[evar :y↦ψ]]^[evar :n↦
patt_free_evar x] =
φ1^[evar :n↦patt_free_evar x]^[[evar :y↦ψ]]IHφ2 : ∀ (x : evar ) (n : db_index)
(ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ
→ φ2^[[evar :y↦ψ]]^[evar :n↦
patt_free_evar x] =
φ2^[evar :n↦patt_free_evar x]^[[evar :y↦ψ]]x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ
patt_app φ1^[[evar :y↦ψ]]^[evar :n'↦patt_free_evar x']
φ2^[[evar :y↦ψ]]^[evar :n'↦patt_free_evar x'] =
patt_app φ1^[evar :n'↦patt_free_evar x']^[[evar :y↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :y↦ψ]]
now rewrite -> IHφ1, -> IHφ2.
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index)
(ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ
→ φ1^[[evar :y↦ψ]]^{evar :n↦x} =
φ1^{evar :n↦x}^[[evar :y↦ψ]]IHφ2 : ∀ (x : evar ) (n : db_index)
(ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ
→ φ2^[[evar :y↦ψ]]^{evar :n↦x} =
φ2^{evar :n↦x}^[[evar :y↦ψ]]x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ
(patt_imp φ1^[[evar :y↦ψ]] φ2^[[evar :y↦ψ]])^{evar :n'↦x'} =
patt_imp φ1^[evar :n'↦patt_free_evar x']^[[evar :y↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :y↦ψ]]
unfold evar_open in *.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index)
(ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ
→ φ1^[[evar :y↦ψ]]^[evar :n↦
patt_free_evar x] =
φ1^[evar :n↦patt_free_evar x]^[[evar :y↦ψ]]IHφ2 : ∀ (x : evar ) (n : db_index)
(ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ
→ φ2^[[evar :y↦ψ]]^[evar :n↦
patt_free_evar x] =
φ2^[evar :n↦patt_free_evar x]^[[evar :y↦ψ]]x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ
(patt_imp φ1^[[evar :y↦ψ]] φ2^[[evar :y↦ψ]])^[evar :n'↦
patt_free_evar x'] =
patt_imp φ1^[evar :n'↦patt_free_evar x']^[[evar :y↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :y↦ψ]]
simpl .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index)
(ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ
→ φ1^[[evar :y↦ψ]]^[evar :n↦
patt_free_evar x] =
φ1^[evar :n↦patt_free_evar x]^[[evar :y↦ψ]]IHφ2 : ∀ (x : evar ) (n : db_index)
(ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ
→ φ2^[[evar :y↦ψ]]^[evar :n↦
patt_free_evar x] =
φ2^[evar :n↦patt_free_evar x]^[[evar :y↦ψ]]x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ
patt_imp φ1^[[evar :y↦ψ]]^[evar :n'↦patt_free_evar x']
φ2^[[evar :y↦ψ]]^[evar :n'↦patt_free_evar x'] =
patt_imp φ1^[evar :n'↦patt_free_evar x']^[[evar :y↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :y↦ψ]]
now rewrite -> IHφ1, -> IHφ2.
* Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index) (ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ → φ^[[evar :y↦ψ]]^{evar :n↦x} = φ^{evar :n↦x}^[[evar :y↦ψ]]x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ
(patt_exists φ^[[evar :y↦ψ]])^{evar :n'↦x'} =
patt_exists
φ^[evar :S n'↦patt_free_evar x']^[[evar :y↦ψ]]
unfold evar_open in *.Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index) (ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ
→ φ^[[evar :y↦ψ]]^[evar :n↦patt_free_evar x] =
φ^[evar :n↦patt_free_evar x]^[[evar :y↦ψ]]x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ
(patt_exists φ^[[evar :y↦ψ]])^[evar :n'↦patt_free_evar
x'] =
patt_exists
φ^[evar :S n'↦patt_free_evar x']^[[evar :y↦ψ]]
simpl .Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index) (ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ
→ φ^[[evar :y↦ψ]]^[evar :n↦patt_free_evar x] =
φ^[evar :n↦patt_free_evar x]^[[evar :y↦ψ]]x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ
patt_exists
φ^[[evar :y↦ψ]]^[evar :S n'↦patt_free_evar x'] =
patt_exists
φ^[evar :S n'↦patt_free_evar x']^[[evar :y↦ψ]]
now rewrite -> IHφ.
* Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index) (ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ → φ^[[evar :y↦ψ]]^{evar :n↦x} = φ^{evar :n↦x}^[[evar :y↦ψ]]x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ
(patt_mu φ^[[evar :y↦ψ]])^{evar :n'↦x'} =
patt_mu φ^[evar :n'↦patt_free_evar x']^[[evar :y↦ψ]]
unfold evar_open in *.Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index) (ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ
→ φ^[[evar :y↦ψ]]^[evar :n↦patt_free_evar x] =
φ^[evar :n↦patt_free_evar x]^[[evar :y↦ψ]]x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ
(patt_mu φ^[[evar :y↦ψ]])^[evar :n'↦patt_free_evar x'] =
patt_mu φ^[evar :n'↦patt_free_evar x']^[[evar :y↦ψ]]
simpl .Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index) (ψ : Pattern) (y : evar ),
x ≠ y
→ well_formed ψ
→ φ^[[evar :y↦ψ]]^[evar :n↦patt_free_evar x] =
φ^[evar :n↦patt_free_evar x]^[[evar :y↦ψ]]x' : evar n' : db_index ψ : Pattern y : evar H : x' ≠ y H0 : well_formed ψ
patt_mu φ^[[evar :y↦ψ]]^[evar :n'↦patt_free_evar x'] =
patt_mu φ^[evar :n'↦patt_free_evar x']^[[evar :y↦ψ]]
now rewrite -> IHφ.
Qed .
Lemma free_evars_free_evar_subst : forall φ ψ x ,
free_evars (φ^[[evar : x ↦ ψ]]) ⊆ free_evars φ ∪ free_evars ψ.Σ : Signature
∀ (φ ψ : Pattern) (x : evar ),
free_evars φ^[[evar :x↦ψ]]
⊆ free_evars φ ∪ free_evars ψ
Proof .Σ : Signature
∀ (φ ψ : Pattern) (x : evar ),
free_evars φ^[[evar :x↦ψ]]
⊆ free_evars φ ∪ free_evars ψ
induction φ; intros ψ x'; simpl .Σ : Signature x : evar ψ : Pattern x' : evar
free_evars
(if decide (x' = x) then ψ else patt_free_evar x)
⊆ {[x]} ∪ free_evars ψ
2 -5 , 7 : apply empty_subseteq.Σ : Signature x : evar ψ : Pattern x' : evar
free_evars
(if decide (x' = x) then ψ else patt_free_evar x)
⊆ {[x]} ∪ free_evars ψ
* Σ : Signature x : evar ψ : Pattern x' : evar
free_evars
(if decide (x' = x) then ψ else patt_free_evar x)
⊆ {[x]} ∪ free_evars ψ
destruct (decide (x' = x)); simpl .Σ : Signature x : evar ψ : Pattern x' : evar e : x' = x
free_evars ψ ⊆ {[x]} ∪ free_evars ψ
** Σ : Signature x : evar ψ : Pattern x' : evar e : x' = x
free_evars ψ ⊆ {[x]} ∪ free_evars ψ
apply union_subseteq_r.
** Σ : Signature x : evar ψ : Pattern x' : evar n : x' ≠ x
{[x]} ⊆ {[x]} ∪ free_evars ψ
apply union_subseteq_l.
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (x : evar ),
free_evars φ1^[[evar :x↦ψ]]
⊆ free_evars φ1 ∪ free_evars ψIHφ2 : ∀ (ψ : Pattern) (x : evar ),
free_evars φ2^[[evar :x↦ψ]]
⊆ free_evars φ2 ∪ free_evars ψψ : Pattern x' : evar
free_evars φ1^[[evar :x'↦ψ]]
∪ free_evars φ2^[[evar :x'↦ψ]]
⊆ free_evars φ1 ∪ free_evars φ2 ∪ free_evars ψ
specialize (IHφ1 ψ x').Σ : Signature φ1, φ2, ψ : Pattern x' : evar IHφ1 : free_evars φ1^[[evar :x'↦ψ]]
⊆ free_evars φ1 ∪ free_evars ψ IHφ2 : ∀ (ψ : Pattern) (x : evar ),
free_evars φ2^[[evar :x↦ψ]]
⊆ free_evars φ2 ∪ free_evars ψ
free_evars φ1^[[evar :x'↦ψ]]
∪ free_evars φ2^[[evar :x'↦ψ]]
⊆ free_evars φ1 ∪ free_evars φ2 ∪ free_evars ψ
specialize (IHφ2 ψ x').Σ : Signature φ1, φ2, ψ : Pattern x' : evar IHφ1 : free_evars φ1^[[evar :x'↦ψ]]
⊆ free_evars φ1 ∪ free_evars ψ IHφ2 : free_evars φ2^[[evar :x'↦ψ]]
⊆ free_evars φ2 ∪ free_evars ψ
free_evars φ1^[[evar :x'↦ψ]]
∪ free_evars φ2^[[evar :x'↦ψ]]
⊆ free_evars φ1 ∪ free_evars φ2 ∪ free_evars ψ
set_solver.
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (x : evar ),
free_evars φ1^[[evar :x↦ψ]]
⊆ free_evars φ1 ∪ free_evars ψIHφ2 : ∀ (ψ : Pattern) (x : evar ),
free_evars φ2^[[evar :x↦ψ]]
⊆ free_evars φ2 ∪ free_evars ψψ : Pattern x' : evar
free_evars φ1^[[evar :x'↦ψ]]
∪ free_evars φ2^[[evar :x'↦ψ]]
⊆ free_evars φ1 ∪ free_evars φ2 ∪ free_evars ψ
specialize (IHφ1 ψ x').Σ : Signature φ1, φ2, ψ : Pattern x' : evar IHφ1 : free_evars φ1^[[evar :x'↦ψ]]
⊆ free_evars φ1 ∪ free_evars ψ IHφ2 : ∀ (ψ : Pattern) (x : evar ),
free_evars φ2^[[evar :x↦ψ]]
⊆ free_evars φ2 ∪ free_evars ψ
free_evars φ1^[[evar :x'↦ψ]]
∪ free_evars φ2^[[evar :x'↦ψ]]
⊆ free_evars φ1 ∪ free_evars φ2 ∪ free_evars ψ
specialize (IHφ2 ψ x').Σ : Signature φ1, φ2, ψ : Pattern x' : evar IHφ1 : free_evars φ1^[[evar :x'↦ψ]]
⊆ free_evars φ1 ∪ free_evars ψ IHφ2 : free_evars φ2^[[evar :x'↦ψ]]
⊆ free_evars φ2 ∪ free_evars ψ
free_evars φ1^[[evar :x'↦ψ]]
∪ free_evars φ2^[[evar :x'↦ψ]]
⊆ free_evars φ1 ∪ free_evars φ2 ∪ free_evars ψ
set_solver.
* Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (x : evar ),
free_evars φ^[[evar :x↦ψ]] ⊆ free_evars φ ∪ free_evars ψψ : Pattern x' : evar
free_evars φ^[[evar :x'↦ψ]]
⊆ free_evars φ ∪ free_evars ψ
apply IHφ.
* Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (x : evar ),
free_evars φ^[[evar :x↦ψ]] ⊆ free_evars φ ∪ free_evars ψψ : Pattern x' : evar
free_evars φ^[[evar :x'↦ψ]]
⊆ free_evars φ ∪ free_evars ψ
apply IHφ.
Qed .
Lemma bound_to_free_variable_subst :
forall φ x m n ψ ,
m > n ->
well_formed_closed_ex_aux ψ 0 ->
well_formed_closed_ex_aux φ m -> x ∉ free_evars φ ->
φ^[evar : n ↦ ψ] = φ^{evar : n ↦ x}^[[evar : x ↦ ψ]].Σ : Signature
∀ (φ : Pattern) (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ m
→ x ∉ free_evars φ
→ φ^[evar :n↦ψ] = φ^{evar :n↦x}^[[evar :x↦ψ]]
Proof .Σ : Signature
∀ (φ : Pattern) (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ m
→ x ∉ free_evars φ
→ φ^[evar :n↦ψ] = φ^{evar :n↦x}^[[evar :x↦ψ]]
induction φ; intros x' m n' ψ H WFψ H0 H1; cbn ; auto .Σ : Signature x, x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_free_evar x) m H1 : x' ∉ free_evars (patt_free_evar x)
patt_free_evar x =
(if decide (x' = x) then ψ else patt_free_evar x)
- Σ : Signature x, x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_free_evar x) m H1 : x' ∉ free_evars (patt_free_evar x)
patt_free_evar x =
(if decide (x' = x) then ψ else patt_free_evar x)
destruct (decide (x' = x)); simpl .Σ : Signature x, x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_free_evar x) m H1 : x' ∉ free_evars (patt_free_evar x) e : x' = x
patt_free_evar x = ψ
+ Σ : Signature x, x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_free_evar x) m H1 : x' ∉ free_evars (patt_free_evar x) e : x' = x
patt_free_evar x = ψ
simpl in H1.Σ : Signature x, x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_free_evar x) m H1 : x' ∉ {[x]} e : x' = x
patt_free_evar x = ψ
apply not_elem_of_singleton_1 in H1.Σ : Signature x, x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_free_evar x) m H1 : x' ≠ x e : x' = x
patt_free_evar x = ψ
congruence .
+ Σ : Signature x, x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_free_evar x) m H1 : x' ∉ free_evars (patt_free_evar x) n : x' ≠ x
patt_free_evar x = patt_free_evar x
reflexivity .
- Σ : Signature n : db_index x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_bound_evar n) m H1 : x' ∉ free_evars (patt_bound_evar n)
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end =
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x'
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end ^[[evar :x'↦ψ]]
case_match; auto . Σ : Signature n : db_index x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_bound_evar n) m H1 : x' ∉ free_evars (patt_bound_evar n) e : n = n' H2 : compare_nat n n' = Nat_equal n n' e
ψ = (patt_free_evar x')^[[evar :x'↦ψ]]
simpl .Σ : Signature n : db_index x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_bound_evar n) m H1 : x' ∉ free_evars (patt_bound_evar n) e : n = n' H2 : compare_nat n n' = Nat_equal n n' e
ψ =
(if decide (x' = x') then ψ else patt_free_evar x')
case_match; auto ; simpl in H0; case_match; auto . Σ : Signature n : db_index x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 l : n < m H4 : decide (n < m) = left l H0 : true H1 : x' ∉ free_evars (patt_bound_evar n) e : n = n' H2 : compare_nat n n' = Nat_equal n n' e n0 : x' ≠ x' H3 : decide (x' = x') = right n0
ψ = patt_free_evar x'
contradiction .Σ : Signature n : db_index x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 n1 : ¬ n < m H4 : decide (n < m) = right n1 H0 : false H1 : x' ∉ free_evars (patt_bound_evar n) e : n = n' H2 : compare_nat n n' = Nat_equal n n' e n0 : x' ≠ x' H3 : decide (x' = x') = right n0
ψ = patt_free_evar x'
lia .
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_app φ1 φ2) m H1 : x' ∉ free_evars (patt_app φ1 φ2)
patt_app φ1^[evar :n'↦ψ] φ2^[evar :n'↦ψ] =
patt_app φ1^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
simpl in H1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_app φ1 φ2) m H1 : x' ∉ free_evars φ1 ∪ free_evars φ2
patt_app φ1^[evar :n'↦ψ] φ2^[evar :n'↦ψ] =
patt_app φ1^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
apply not_elem_of_union in H1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_app φ1 φ2) m H1 : (x' ∉ free_evars φ1) ∧ x' ∉ free_evars φ2
patt_app φ1^[evar :n'↦ψ] φ2^[evar :n'↦ψ] =
patt_app φ1^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
destruct H1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_app φ1 φ2) m H1 : x' ∉ free_evars φ1 H2 : x' ∉ free_evars φ2
patt_app φ1^[evar :n'↦ψ] φ2^[evar :n'↦ψ] =
patt_app φ1^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
simpl in H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ1 m &&
well_formed_closed_ex_aux φ2 m H1 : x' ∉ free_evars φ1 H2 : x' ∉ free_evars φ2
patt_app φ1^[evar :n'↦ψ] φ2^[evar :n'↦ψ] =
patt_app φ1^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
apply andb_true_iff in H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ1 m = true
∧ well_formed_closed_ex_aux φ2 m = true H1 : x' ∉ free_evars φ1 H2 : x' ∉ free_evars φ2
patt_app φ1^[evar :n'↦ψ] φ2^[evar :n'↦ψ] =
patt_app φ1^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
destruct H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ1 m = true H3 : well_formed_closed_ex_aux φ2 m = true H1 : x' ∉ free_evars φ1 H2 : x' ∉ free_evars φ2
patt_app φ1^[evar :n'↦ψ] φ2^[evar :n'↦ψ] =
patt_app φ1^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
erewrite -> IHφ1, -> IHφ2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ1 m = true H3 : well_formed_closed_ex_aux φ2 m = true H1 : x' ∉ free_evars φ1 H2 : x' ∉ free_evars φ2
patt_app φ1^{evar :n'↦?x }^[[evar :?x ↦ψ]]
φ2^{evar :n'↦?x0 }^[[evar :?x0 ↦ψ]] =
patt_app φ1^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
reflexivity .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ1 m = true H3 : well_formed_closed_ex_aux φ2 m = true H1 : x' ∉ free_evars φ1 H2 : x' ∉ free_evars φ2
?m0 > n'
all : eassumption .
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_imp φ1 φ2) m H1 : x' ∉ free_evars (patt_imp φ1 φ2)
patt_imp φ1^[evar :n'↦ψ] φ2^[evar :n'↦ψ] =
patt_imp φ1^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
simpl in H1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_imp φ1 φ2) m H1 : x' ∉ free_evars φ1 ∪ free_evars φ2
patt_imp φ1^[evar :n'↦ψ] φ2^[evar :n'↦ψ] =
patt_imp φ1^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
apply not_elem_of_union in H1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_imp φ1 φ2) m H1 : (x' ∉ free_evars φ1) ∧ x' ∉ free_evars φ2
patt_imp φ1^[evar :n'↦ψ] φ2^[evar :n'↦ψ] =
patt_imp φ1^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
destruct H1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_imp φ1 φ2) m H1 : x' ∉ free_evars φ1 H2 : x' ∉ free_evars φ2
patt_imp φ1^[evar :n'↦ψ] φ2^[evar :n'↦ψ] =
patt_imp φ1^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
simpl in H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ1 m &&
well_formed_closed_ex_aux φ2 m H1 : x' ∉ free_evars φ1 H2 : x' ∉ free_evars φ2
patt_imp φ1^[evar :n'↦ψ] φ2^[evar :n'↦ψ] =
patt_imp φ1^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
apply andb_true_iff in H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ1 m = true
∧ well_formed_closed_ex_aux φ2 m = true H1 : x' ∉ free_evars φ1 H2 : x' ∉ free_evars φ2
patt_imp φ1^[evar :n'↦ψ] φ2^[evar :n'↦ψ] =
patt_imp φ1^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
destruct H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ1 m = true H3 : well_formed_closed_ex_aux φ2 m = true H1 : x' ∉ free_evars φ1 H2 : x' ∉ free_evars φ2
patt_imp φ1^[evar :n'↦ψ] φ2^[evar :n'↦ψ] =
patt_imp φ1^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
erewrite -> IHφ1, -> IHφ2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ1 m = true H3 : well_formed_closed_ex_aux φ2 m = true H1 : x' ∉ free_evars φ1 H2 : x' ∉ free_evars φ2
patt_imp φ1^{evar :n'↦?x }^[[evar :?x ↦ψ]]
φ2^{evar :n'↦?x0 }^[[evar :?x0 ↦ψ]] =
patt_imp φ1^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
φ2^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
reflexivity .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ1 m
→ x ∉ free_evars φ1
→ φ1^[evar :n↦ψ] =
φ1^{evar :n↦x}^[[evar :x↦ψ]]IHφ2 : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ2 m
→ x ∉ free_evars φ2
→ φ2^[evar :n↦ψ] =
φ2^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ1 m = true H3 : well_formed_closed_ex_aux φ2 m = true H1 : x' ∉ free_evars φ1 H2 : x' ∉ free_evars φ2
?m0 > n'
all : eassumption .
- Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ m
→ x ∉ free_evars φ → φ^[evar :n↦ψ] = φ^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_exists φ) m H1 : x' ∉ free_evars (patt_exists φ)
patt_exists φ^[evar :S n'↦ψ] =
patt_exists
φ^[evar :S n'↦patt_free_evar x']^[[evar :x'↦ψ]]
simpl in H0, H1.Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ m
→ x ∉ free_evars φ → φ^[evar :n↦ψ] = φ^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ (S m) H1 : x' ∉ free_evars φ
patt_exists φ^[evar :S n'↦ψ] =
patt_exists
φ^[evar :S n'↦patt_free_evar x']^[[evar :x'↦ψ]]
erewrite IHφ.Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ m
→ x ∉ free_evars φ → φ^[evar :n↦ψ] = φ^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ (S m) H1 : x' ∉ free_evars φ
patt_exists φ^{evar :S n'↦?x }^[[evar :?x ↦ψ]] =
patt_exists
φ^[evar :S n'↦patt_free_evar x']^[[evar :x'↦ψ]]
reflexivity .Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ m
→ x ∉ free_evars φ → φ^[evar :n↦ψ] = φ^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ (S m) H1 : x' ∉ free_evars φ
?m > S n'
instantiate (1 := S m).Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ m
→ x ∉ free_evars φ → φ^[evar :n↦ψ] = φ^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ (S m) H1 : x' ∉ free_evars φ
S m > S n'
all : try eassumption .Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ m
→ x ∉ free_evars φ → φ^[evar :n↦ψ] = φ^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ (S m) H1 : x' ∉ free_evars φ
S m > S n'
lia .
- Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ m
→ x ∉ free_evars φ → φ^[evar :n↦ψ] = φ^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux (patt_mu φ) m H1 : x' ∉ free_evars (patt_mu φ)
patt_mu φ^[evar :n'↦ψ] =
patt_mu φ^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
simpl in H0, H1.Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ m
→ x ∉ free_evars φ → φ^[evar :n↦ψ] = φ^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ m H1 : x' ∉ free_evars φ
patt_mu φ^[evar :n'↦ψ] =
patt_mu φ^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
erewrite IHφ.Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ m
→ x ∉ free_evars φ → φ^[evar :n↦ψ] = φ^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ m H1 : x' ∉ free_evars φ
patt_mu φ^{evar :n'↦?x }^[[evar :?x ↦ψ]] =
patt_mu φ^[evar :n'↦patt_free_evar x']^[[evar :x'↦ψ]]
reflexivity .Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_ex_aux ψ 0
→ well_formed_closed_ex_aux φ m
→ x ∉ free_evars φ → φ^[evar :n↦ψ] = φ^{evar :n↦x}^[[evar :x↦ψ]]x' : evar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_ex_aux ψ 0 H0 : well_formed_closed_ex_aux φ m H1 : x' ∉ free_evars φ
?m > n'
all : eassumption .
Qed .
Lemma bound_to_free_set_variable_subst :
forall φ X m n ψ ,
m > n ->
well_formed_closed_mu_aux ψ 0 ->
well_formed_closed_mu_aux φ m -> X ∉ free_svars φ ->
φ^[svar: n ↦ ψ] = φ^{svar: n ↦ X}^[[svar: X ↦ ψ]].Σ : Signature
∀ (φ : Pattern) (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ m
→ X ∉ free_svars φ
→ φ^[svar:n↦ψ] = φ^{svar:n↦X}^[[svar:X↦ψ]]
Proof .Σ : Signature
∀ (φ : Pattern) (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ m
→ X ∉ free_svars φ
→ φ^[svar:n↦ψ] = φ^{svar:n↦X}^[[svar:X↦ψ]]
induction φ; intros x' m n' ψ H WFψ H0 H1; cbn ; auto .Σ : Signature x, x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_free_svar x) m H1 : x' ∉ free_svars (patt_free_svar x)
patt_free_svar x =
(if decide (x' = x) then ψ else patt_free_svar x)
- Σ : Signature x, x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_free_svar x) m H1 : x' ∉ free_svars (patt_free_svar x)
patt_free_svar x =
(if decide (x' = x) then ψ else patt_free_svar x)
destruct (decide (x' = x)); simpl .Σ : Signature x, x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_free_svar x) m H1 : x' ∉ free_svars (patt_free_svar x) e : x' = x
patt_free_svar x = ψ
+ Σ : Signature x, x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_free_svar x) m H1 : x' ∉ free_svars (patt_free_svar x) e : x' = x
patt_free_svar x = ψ
simpl in H1.Σ : Signature x, x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_free_svar x) m H1 : x' ∉ {[x]} e : x' = x
patt_free_svar x = ψ
apply not_elem_of_singleton_1 in H1.Σ : Signature x, x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_free_svar x) m H1 : x' ≠ x e : x' = x
patt_free_svar x = ψ
congruence .
+ Σ : Signature x, x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_free_svar x) m H1 : x' ∉ free_svars (patt_free_svar x) n : x' ≠ x
patt_free_svar x = patt_free_svar x
reflexivity .
- Σ : Signature n : db_index x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_bound_svar n) m H1 : x' ∉ free_svars (patt_bound_svar n)
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end =
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar x'
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end ^[[svar:x'↦ψ]]
case_match; auto . Σ : Signature n : db_index x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_bound_svar n) m H1 : x' ∉ free_svars (patt_bound_svar n) e : n = n' H2 : compare_nat n n' = Nat_equal n n' e
ψ = (patt_free_svar x')^[[svar:x'↦ψ]]
simpl .Σ : Signature n : db_index x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_bound_svar n) m H1 : x' ∉ free_svars (patt_bound_svar n) e : n = n' H2 : compare_nat n n' = Nat_equal n n' e
ψ =
(if decide (x' = x') then ψ else patt_free_svar x')
case_match; auto ; simpl in H0; case_match; auto . Σ : Signature n : db_index x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 l : n < m H4 : decide (n < m) = left l H0 : true H1 : x' ∉ free_svars (patt_bound_svar n) e : n = n' H2 : compare_nat n n' = Nat_equal n n' e n0 : x' ≠ x' H3 : decide (x' = x') = right n0
ψ = patt_free_svar x'
contradiction .Σ : Signature n : db_index x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 n1 : ¬ n < m H4 : decide (n < m) = right n1 H0 : false H1 : x' ∉ free_svars (patt_bound_svar n) e : n = n' H2 : compare_nat n n' = Nat_equal n n' e n0 : x' ≠ x' H3 : decide (x' = x') = right n0
ψ = patt_free_svar x'
lia .
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_app φ1 φ2) m H1 : x' ∉ free_svars (patt_app φ1 φ2)
patt_app φ1^[svar:n'↦ψ] φ2^[svar:n'↦ψ] =
patt_app φ1^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
φ2^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
simpl in H1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_app φ1 φ2) m H1 : x' ∉ free_svars φ1 ∪ free_svars φ2
patt_app φ1^[svar:n'↦ψ] φ2^[svar:n'↦ψ] =
patt_app φ1^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
φ2^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
apply not_elem_of_union in H1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_app φ1 φ2) m H1 : (x' ∉ free_svars φ1) ∧ x' ∉ free_svars φ2
patt_app φ1^[svar:n'↦ψ] φ2^[svar:n'↦ψ] =
patt_app φ1^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
φ2^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
destruct H1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_app φ1 φ2) m H1 : x' ∉ free_svars φ1 H2 : x' ∉ free_svars φ2
patt_app φ1^[svar:n'↦ψ] φ2^[svar:n'↦ψ] =
patt_app φ1^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
φ2^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
simpl in H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ1 m &&
well_formed_closed_mu_aux φ2 m H1 : x' ∉ free_svars φ1 H2 : x' ∉ free_svars φ2
patt_app φ1^[svar:n'↦ψ] φ2^[svar:n'↦ψ] =
patt_app φ1^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
φ2^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
apply andb_true_iff in H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ1 m = true
∧ well_formed_closed_mu_aux φ2 m = true H1 : x' ∉ free_svars φ1 H2 : x' ∉ free_svars φ2
patt_app φ1^[svar:n'↦ψ] φ2^[svar:n'↦ψ] =
patt_app φ1^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
φ2^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
destruct H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ1 m = true H3 : well_formed_closed_mu_aux φ2 m = true H1 : x' ∉ free_svars φ1 H2 : x' ∉ free_svars φ2
patt_app φ1^[svar:n'↦ψ] φ2^[svar:n'↦ψ] =
patt_app φ1^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
φ2^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
erewrite -> IHφ1, -> IHφ2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ1 m = true H3 : well_formed_closed_mu_aux φ2 m = true H1 : x' ∉ free_svars φ1 H2 : x' ∉ free_svars φ2
patt_app φ1^{svar:n'↦?X }^[[svar:?X ↦ψ]]
φ2^{svar:n'↦?X0 }^[[svar:?X0 ↦ψ]] =
patt_app φ1^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
φ2^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
reflexivity .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ1 m = true H3 : well_formed_closed_mu_aux φ2 m = true H1 : x' ∉ free_svars φ1 H2 : x' ∉ free_svars φ2
?m0 > n'
all : eassumption .
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_imp φ1 φ2) m H1 : x' ∉ free_svars (patt_imp φ1 φ2)
patt_imp φ1^[svar:n'↦ψ] φ2^[svar:n'↦ψ] =
patt_imp φ1^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
φ2^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
simpl in H1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_imp φ1 φ2) m H1 : x' ∉ free_svars φ1 ∪ free_svars φ2
patt_imp φ1^[svar:n'↦ψ] φ2^[svar:n'↦ψ] =
patt_imp φ1^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
φ2^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
apply not_elem_of_union in H1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_imp φ1 φ2) m H1 : (x' ∉ free_svars φ1) ∧ x' ∉ free_svars φ2
patt_imp φ1^[svar:n'↦ψ] φ2^[svar:n'↦ψ] =
patt_imp φ1^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
φ2^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
destruct H1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_imp φ1 φ2) m H1 : x' ∉ free_svars φ1 H2 : x' ∉ free_svars φ2
patt_imp φ1^[svar:n'↦ψ] φ2^[svar:n'↦ψ] =
patt_imp φ1^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
φ2^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
simpl in H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ1 m &&
well_formed_closed_mu_aux φ2 m H1 : x' ∉ free_svars φ1 H2 : x' ∉ free_svars φ2
patt_imp φ1^[svar:n'↦ψ] φ2^[svar:n'↦ψ] =
patt_imp φ1^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
φ2^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
apply andb_true_iff in H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ1 m = true
∧ well_formed_closed_mu_aux φ2 m = true H1 : x' ∉ free_svars φ1 H2 : x' ∉ free_svars φ2
patt_imp φ1^[svar:n'↦ψ] φ2^[svar:n'↦ψ] =
patt_imp φ1^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
φ2^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
destruct H0.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ1 m = true H3 : well_formed_closed_mu_aux φ2 m = true H1 : x' ∉ free_svars φ1 H2 : x' ∉ free_svars φ2
patt_imp φ1^[svar:n'↦ψ] φ2^[svar:n'↦ψ] =
patt_imp φ1^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
φ2^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
erewrite -> IHφ1, -> IHφ2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ1 m = true H3 : well_formed_closed_mu_aux φ2 m = true H1 : x' ∉ free_svars φ1 H2 : x' ∉ free_svars φ2
patt_imp φ1^{svar:n'↦?X }^[[svar:?X ↦ψ]]
φ2^{svar:n'↦?X0 }^[[svar:?X0 ↦ψ]] =
patt_imp φ1^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
φ2^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
reflexivity .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ1 m
→ X ∉ free_svars φ1
→ φ1^[svar:n↦ψ] =
φ1^{svar:n↦X}^[[svar:X↦ψ]]IHφ2 : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ2 m
→ X ∉ free_svars φ2
→ φ2^[svar:n↦ψ] =
φ2^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ1 m = true H3 : well_formed_closed_mu_aux φ2 m = true H1 : x' ∉ free_svars φ1 H2 : x' ∉ free_svars φ2
?m0 > n'
all : eassumption .
- Σ : Signature φ : Pattern IHφ : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ m
→ X ∉ free_svars φ → φ^[svar:n↦ψ] = φ^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_exists φ) m H1 : x' ∉ free_svars (patt_exists φ)
patt_exists φ^[svar:n'↦ψ] =
patt_exists
φ^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
simpl in H0, H1.Σ : Signature φ : Pattern IHφ : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ m
→ X ∉ free_svars φ → φ^[svar:n↦ψ] = φ^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ m H1 : x' ∉ free_svars φ
patt_exists φ^[svar:n'↦ψ] =
patt_exists
φ^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
erewrite IHφ.Σ : Signature φ : Pattern IHφ : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ m
→ X ∉ free_svars φ → φ^[svar:n↦ψ] = φ^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ m H1 : x' ∉ free_svars φ
patt_exists φ^{svar:n'↦?X }^[[svar:?X ↦ψ]] =
patt_exists
φ^[svar:n'↦patt_free_svar x']^[[svar:x'↦ψ]]
reflexivity .Σ : Signature φ : Pattern IHφ : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ m
→ X ∉ free_svars φ → φ^[svar:n↦ψ] = φ^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ m H1 : x' ∉ free_svars φ
?m > n'
all : eassumption .
- Σ : Signature φ : Pattern IHφ : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ m
→ X ∉ free_svars φ → φ^[svar:n↦ψ] = φ^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux (patt_mu φ) m H1 : x' ∉ free_svars (patt_mu φ)
patt_mu φ^[svar:S n'↦ψ] =
patt_mu φ^[svar:S n'↦patt_free_svar x']^[[svar:x'↦ψ]]
simpl in H0, H1.Σ : Signature φ : Pattern IHφ : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ m
→ X ∉ free_svars φ → φ^[svar:n↦ψ] = φ^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ (S m) H1 : x' ∉ free_svars φ
patt_mu φ^[svar:S n'↦ψ] =
patt_mu φ^[svar:S n'↦patt_free_svar x']^[[svar:x'↦ψ]]
erewrite IHφ.Σ : Signature φ : Pattern IHφ : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ m
→ X ∉ free_svars φ → φ^[svar:n↦ψ] = φ^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ (S m) H1 : x' ∉ free_svars φ
patt_mu φ^{svar:S n'↦?X }^[[svar:?X ↦ψ]] =
patt_mu φ^[svar:S n'↦patt_free_svar x']^[[svar:x'↦ψ]]
reflexivity .Σ : Signature φ : Pattern IHφ : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ m
→ X ∉ free_svars φ → φ^[svar:n↦ψ] = φ^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ (S m) H1 : x' ∉ free_svars φ
?m > S n'
instantiate (1 := S m).Σ : Signature φ : Pattern IHφ : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ m
→ X ∉ free_svars φ → φ^[svar:n↦ψ] = φ^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ (S m) H1 : x' ∉ free_svars φ
S m > S n'
all : try eassumption .Σ : Signature φ : Pattern IHφ : ∀ (X : svar) (m n : nat) (ψ : Pattern),
m > n
→ well_formed_closed_mu_aux ψ 0
→ well_formed_closed_mu_aux φ m
→ X ∉ free_svars φ → φ^[svar:n↦ψ] = φ^{svar:n↦X}^[[svar:X↦ψ]]x' : svar m, n' : nat ψ : Pattern H : m > n' WFψ : well_formed_closed_mu_aux ψ 0 H0 : well_formed_closed_mu_aux φ (S m) H1 : x' ∉ free_svars φ
S m > S n'
lia .
Qed .
Lemma evar_open_no_negative_occurrence :
forall φ db1 db2 x ,
(no_negative_occurrence_db_b db1 (φ^{evar : db2 ↦ x}) ->
no_negative_occurrence_db_b db1 φ) /\
(no_positive_occurrence_db_b db1 (φ^{evar : db2 ↦ x}) ->
no_positive_occurrence_db_b db1 φ).Σ : Signature
∀ (φ : Pattern) (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1 φ^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ)
∧ (no_positive_occurrence_db_b db1 φ^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ)
Proof .Σ : Signature
∀ (φ : Pattern) (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1 φ^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ)
∧ (no_positive_occurrence_db_b db1 φ^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ)
induction φ; intros db1 db2 x'; simpl ; auto .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar
(no_negative_occurrence_db_b db1
(patt_app φ1 φ2)^{evar :db2↦x'}
→ no_negative_occurrence_db_b db1 (patt_app φ1 φ2))
∧ (no_positive_occurrence_db_b db1
(patt_app φ1 φ2)^{evar :db2↦x'}
→ no_positive_occurrence_db_b db1 (patt_app φ1 φ2))
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar
(no_negative_occurrence_db_b db1
(patt_app φ1 φ2)^{evar :db2↦x'}
→ no_negative_occurrence_db_b db1 (patt_app φ1 φ2))
∧ (no_positive_occurrence_db_b db1
(patt_app φ1 φ2)^{evar :db2↦x'}
→ no_positive_occurrence_db_b db1 (patt_app φ1 φ2))
split ; intros .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar H : no_negative_occurrence_db_b db1
(patt_app φ1 φ2)^{evar :db2↦x'}
no_negative_occurrence_db_b db1 (patt_app φ1 φ2)
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar H : no_negative_occurrence_db_b db1
(patt_app φ1 φ2)^{evar :db2↦x'}
no_negative_occurrence_db_b db1 (patt_app φ1 φ2)
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar E1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) db1
((fix bevar_subst
(psi : Pattern) (x : db_index)
(phi : Pattern) {struct phi} : Pattern :=
match phi with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar n =>
match compare_nat n x with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end
| patt_bound_svar n => patt_bound_svar n
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 =>
patt_app (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 =>
patt_imp (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_exists phi' =>
patt_exists
(bevar_subst psi (S x) phi')
| patt_mu phi' =>
patt_mu (bevar_subst psi x phi')
end ) (patt_free_evar x') db2 φ1) = true E2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) db1
((fix bevar_subst
(psi : Pattern) (x : db_index)
(phi : Pattern) {struct phi} : Pattern :=
match phi with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar n =>
match compare_nat n x with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end
| patt_bound_svar n => patt_bound_svar n
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 =>
patt_app (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 =>
patt_imp (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_exists phi' =>
patt_exists
(bevar_subst psi (S x) phi')
| patt_mu phi' =>
patt_mu (bevar_subst psi x phi')
end ) (patt_free_evar x') db2 φ2) = true
no_negative_occurrence_db_b db1 (patt_app φ1 φ2)
apply IHφ1 in E1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar E1 : no_negative_occurrence_db_b db1 φ1 E2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) db1
((fix bevar_subst
(psi : Pattern) (x : db_index)
(phi : Pattern) {struct phi} : Pattern :=
match phi with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar n =>
match compare_nat n x with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end
| patt_bound_svar n => patt_bound_svar n
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 =>
patt_app (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 =>
patt_imp (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_exists phi' =>
patt_exists
(bevar_subst psi (S x) phi')
| patt_mu phi' =>
patt_mu (bevar_subst psi x phi')
end ) (patt_free_evar x') db2 φ2) = true
no_negative_occurrence_db_b db1 (patt_app φ1 φ2)
apply IHφ2 in E2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar E1 : no_negative_occurrence_db_b db1 φ1 E2 : no_negative_occurrence_db_b db1 φ2
no_negative_occurrence_db_b db1 (patt_app φ1 φ2)
cbn .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar E1 : no_negative_occurrence_db_b db1 φ1 E2 : no_negative_occurrence_db_b db1 φ2
no_negative_occurrence_db_b db1 φ1 &&
no_negative_occurrence_db_b db1 φ2
now rewrite -> E1, -> E2.
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar H : no_positive_occurrence_db_b db1
(patt_app φ1 φ2)^{evar :db2↦x'}
no_positive_occurrence_db_b db1 (patt_app φ1 φ2)
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar E1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) db1
((fix bevar_subst
(psi : Pattern) (x : db_index)
(phi : Pattern) {struct phi} : Pattern :=
match phi with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar n =>
match compare_nat n x with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end
| patt_bound_svar n => patt_bound_svar n
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 =>
patt_app (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 =>
patt_imp (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_exists phi' =>
patt_exists
(bevar_subst psi (S x) phi')
| patt_mu phi' =>
patt_mu (bevar_subst psi x phi')
end ) (patt_free_evar x') db2 φ1) = true E2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) db1
((fix bevar_subst
(psi : Pattern) (x : db_index)
(phi : Pattern) {struct phi} : Pattern :=
match phi with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar n =>
match compare_nat n x with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end
| patt_bound_svar n => patt_bound_svar n
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 =>
patt_app (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 =>
patt_imp (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_exists phi' =>
patt_exists
(bevar_subst psi (S x) phi')
| patt_mu phi' =>
patt_mu (bevar_subst psi x phi')
end ) (patt_free_evar x') db2 φ2) = true
no_positive_occurrence_db_b db1 (patt_app φ1 φ2)
apply IHφ1 in E1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar E1 : no_positive_occurrence_db_b db1 φ1 E2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) db1
((fix bevar_subst
(psi : Pattern) (x : db_index)
(phi : Pattern) {struct phi} : Pattern :=
match phi with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar n =>
match compare_nat n x with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end
| patt_bound_svar n => patt_bound_svar n
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 =>
patt_app (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 =>
patt_imp (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_exists phi' =>
patt_exists
(bevar_subst psi (S x) phi')
| patt_mu phi' =>
patt_mu (bevar_subst psi x phi')
end ) (patt_free_evar x') db2 φ2) = true
no_positive_occurrence_db_b db1 (patt_app φ1 φ2)
apply IHφ2 in E2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar E1 : no_positive_occurrence_db_b db1 φ1 E2 : no_positive_occurrence_db_b db1 φ2
no_positive_occurrence_db_b db1 (patt_app φ1 φ2)
cbn .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar E1 : no_positive_occurrence_db_b db1 φ1 E2 : no_positive_occurrence_db_b db1 φ2
no_positive_occurrence_db_b db1 φ1 &&
no_positive_occurrence_db_b db1 φ2
now rewrite -> E1, -> E2.
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar
(no_negative_occurrence_db_b db1
(patt_imp φ1 φ2)^{evar :db2↦x'}
→ no_negative_occurrence_db_b db1 (patt_imp φ1 φ2))
∧ (no_positive_occurrence_db_b db1
(patt_imp φ1 φ2)^{evar :db2↦x'}
→ no_positive_occurrence_db_b db1 (patt_imp φ1 φ2))
split ; intros .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar H : no_negative_occurrence_db_b db1
(patt_imp φ1 φ2)^{evar :db2↦x'}
no_negative_occurrence_db_b db1 (patt_imp φ1 φ2)
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar H : no_negative_occurrence_db_b db1
(patt_imp φ1 φ2)^{evar :db2↦x'}
no_negative_occurrence_db_b db1 (patt_imp φ1 φ2)
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar E1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) db1
((fix bevar_subst
(psi : Pattern) (x : db_index)
(phi : Pattern) {struct phi} : Pattern :=
match phi with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar n =>
match compare_nat n x with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end
| patt_bound_svar n => patt_bound_svar n
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 =>
patt_app (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 =>
patt_imp (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_exists phi' =>
patt_exists
(bevar_subst psi (S x) phi')
| patt_mu phi' =>
patt_mu (bevar_subst psi x phi')
end ) (patt_free_evar x') db2 φ1) = true E2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) db1
((fix bevar_subst
(psi : Pattern) (x : db_index)
(phi : Pattern) {struct phi} : Pattern :=
match phi with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar n =>
match compare_nat n x with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end
| patt_bound_svar n => patt_bound_svar n
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 =>
patt_app (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 =>
patt_imp (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_exists phi' =>
patt_exists
(bevar_subst psi (S x) phi')
| patt_mu phi' =>
patt_mu (bevar_subst psi x phi')
end ) (patt_free_evar x') db2 φ2) = true
no_negative_occurrence_db_b db1 (patt_imp φ1 φ2)
apply IHφ1 in E1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar E1 : no_positive_occurrence_db_b db1 φ1 E2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) db1
((fix bevar_subst
(psi : Pattern) (x : db_index)
(phi : Pattern) {struct phi} : Pattern :=
match phi with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar n =>
match compare_nat n x with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end
| patt_bound_svar n => patt_bound_svar n
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 =>
patt_app (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 =>
patt_imp (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_exists phi' =>
patt_exists
(bevar_subst psi (S x) phi')
| patt_mu phi' =>
patt_mu (bevar_subst psi x phi')
end ) (patt_free_evar x') db2 φ2) = true
no_negative_occurrence_db_b db1 (patt_imp φ1 φ2)
apply IHφ2 in E2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar E1 : no_positive_occurrence_db_b db1 φ1 E2 : no_negative_occurrence_db_b db1 φ2
no_negative_occurrence_db_b db1 (patt_imp φ1 φ2)
cbn .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar E1 : no_positive_occurrence_db_b db1 φ1 E2 : no_negative_occurrence_db_b db1 φ2
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) db1 φ1 &&
no_negative_occurrence_db_b db1 φ2
now rewrite -> E1, -> E2.
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar H : no_positive_occurrence_db_b db1
(patt_imp φ1 φ2)^{evar :db2↦x'}
no_positive_occurrence_db_b db1 (patt_imp φ1 φ2)
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar E1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) db1
((fix bevar_subst
(psi : Pattern) (x : db_index)
(phi : Pattern) {struct phi} : Pattern :=
match phi with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar n =>
match compare_nat n x with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end
| patt_bound_svar n => patt_bound_svar n
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 =>
patt_app (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 =>
patt_imp (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_exists phi' =>
patt_exists
(bevar_subst psi (S x) phi')
| patt_mu phi' =>
patt_mu (bevar_subst psi x phi')
end ) (patt_free_evar x') db2 φ1) = true E2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) db1
((fix bevar_subst
(psi : Pattern) (x : db_index)
(phi : Pattern) {struct phi} : Pattern :=
match phi with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar n =>
match compare_nat n x with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end
| patt_bound_svar n => patt_bound_svar n
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 =>
patt_app (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 =>
patt_imp (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_exists phi' =>
patt_exists
(bevar_subst psi (S x) phi')
| patt_mu phi' =>
patt_mu (bevar_subst psi x phi')
end ) (patt_free_evar x') db2 φ2) = true
no_positive_occurrence_db_b db1 (patt_imp φ1 φ2)
apply IHφ1 in E1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar E1 : no_negative_occurrence_db_b db1 φ1 E2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) db1
((fix bevar_subst
(psi : Pattern) (x : db_index)
(phi : Pattern) {struct phi} : Pattern :=
match phi with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar n =>
match compare_nat n x with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end
| patt_bound_svar n => patt_bound_svar n
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 =>
patt_app (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 =>
patt_imp (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_exists phi' =>
patt_exists
(bevar_subst psi (S x) phi')
| patt_mu phi' =>
patt_mu (bevar_subst psi x phi')
end ) (patt_free_evar x') db2 φ2) = true
no_positive_occurrence_db_b db1 (patt_imp φ1 φ2)
apply IHφ2 in E2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar E1 : no_negative_occurrence_db_b db1 φ1 E2 : no_positive_occurrence_db_b db1 φ2
no_positive_occurrence_db_b db1 (patt_imp φ1 φ2)
cbn .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ1)
∧ (no_positive_occurrence_db_b db1
φ1^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ1)IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ2)
∧ (no_positive_occurrence_db_b db1
φ2^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ2)db1, db2 : db_index x' : evar E1 : no_negative_occurrence_db_b db1 φ1 E2 : no_positive_occurrence_db_b db1 φ2
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) db1 φ1 &&
no_positive_occurrence_db_b db1 φ2
now rewrite -> E1, -> E2.
* Σ : Signature φ : Pattern IHφ : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1 φ^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ)
∧ (no_positive_occurrence_db_b db1 φ^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ)db1, db2 : db_index x' : evar
(no_negative_occurrence_db_b db1
(patt_exists φ)^{evar :db2↦x'}
→ no_negative_occurrence_db_b db1 (patt_exists φ))
∧ (no_positive_occurrence_db_b db1
(patt_exists φ)^{evar :db2↦x'}
→ no_positive_occurrence_db_b db1 (patt_exists φ))
cbn .Σ : Signature φ : Pattern IHφ : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1 φ^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ)
∧ (no_positive_occurrence_db_b db1 φ^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ)db1, db2 : db_index x' : evar
(no_negative_occurrence_db_b db1
φ^[evar :S db2↦patt_free_evar x']
→ no_negative_occurrence_db_b db1 φ)
∧ (no_positive_occurrence_db_b db1
φ^[evar :S db2↦patt_free_evar x']
→ no_positive_occurrence_db_b db1 φ)
split ; intros ; eapply IHφ; eassumption .
* Σ : Signature φ : Pattern IHφ : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1 φ^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ)
∧ (no_positive_occurrence_db_b db1 φ^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ)db1, db2 : db_index x' : evar
(no_negative_occurrence_db_b db1
(patt_mu φ)^{evar :db2↦x'}
→ no_negative_occurrence_db_b db1 (patt_mu φ))
∧ (no_positive_occurrence_db_b db1
(patt_mu φ)^{evar :db2↦x'}
→ no_positive_occurrence_db_b db1 (patt_mu φ))
cbn .Σ : Signature φ : Pattern IHφ : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1 φ^{evar :db2↦x}
→ no_negative_occurrence_db_b db1 φ)
∧ (no_positive_occurrence_db_b db1 φ^{evar :db2↦x}
→ no_positive_occurrence_db_b db1 φ)db1, db2 : db_index x' : evar
(no_negative_occurrence_db_b (S db1)
φ^[evar :db2↦patt_free_evar x']
→ no_negative_occurrence_db_b (S db1) φ)
∧ (no_positive_occurrence_db_b (S db1)
φ^[evar :db2↦patt_free_evar x']
→ no_positive_occurrence_db_b (S db1) φ)
split ; intros ; eapply IHφ; eassumption .
Qed .
Lemma evar_open_positive : forall φ n x ,
well_formed_positive (φ^{evar : n ↦ x}) = true ->
well_formed_positive φ = true.Σ : Signature
∀ (φ : Pattern) (n : db_index) (x : evar ),
well_formed_positive φ^{evar :n↦x} = true
→ well_formed_positive φ = true
Proof .Σ : Signature
∀ (φ : Pattern) (n : db_index) (x : evar ),
well_formed_positive φ^{evar :n↦x} = true
→ well_formed_positive φ = true
induction φ; intros n' x' H; cbn ; auto .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (n : db_index) (x : evar ),
well_formed_positive φ1^{evar :n↦x} = true
→ well_formed_positive φ1 = trueIHφ2 : ∀ (n : db_index) (x : evar ),
well_formed_positive φ2^{evar :n↦x} = true
→ well_formed_positive φ2 = truen' : db_index x' : evar H : well_formed_positive (patt_app φ1 φ2)^{evar :n'↦x'} =
true
well_formed_positive φ1 && well_formed_positive φ2 =
true
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (n : db_index) (x : evar ),
well_formed_positive φ1^{evar :n↦x} = true
→ well_formed_positive φ1 = trueIHφ2 : ∀ (n : db_index) (x : evar ),
well_formed_positive φ2^{evar :n↦x} = true
→ well_formed_positive φ2 = truen' : db_index x' : evar H : well_formed_positive (patt_app φ1 φ2)^{evar :n'↦x'} =
true
well_formed_positive φ1 && well_formed_positive φ2 =
true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (n : db_index) (x : evar ),
well_formed_positive φ1^{evar :n↦x} = true
→ well_formed_positive φ1 = trueIHφ2 : ∀ (n : db_index) (x : evar ),
well_formed_positive φ2^{evar :n↦x} = true
→ well_formed_positive φ2 = truen' : db_index x' : evar H : well_formed_positive
φ1^[evar :n'↦patt_free_evar x'] &&
well_formed_positive
φ2^[evar :n'↦patt_free_evar x'] = true
well_formed_positive φ1 && well_formed_positive φ2 =
true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (n : db_index) (x : evar ),
well_formed_positive φ1^{evar :n↦x} = true
→ well_formed_positive φ1 = trueIHφ2 : ∀ (n : db_index) (x : evar ),
well_formed_positive φ2^{evar :n↦x} = true
→ well_formed_positive φ2 = truen' : db_index x' : evar E1 : well_formed_positive
φ1^[evar :n'↦patt_free_evar x'] = true E2 : well_formed_positive
φ2^[evar :n'↦patt_free_evar x'] = true
well_formed_positive φ1 && well_formed_positive φ2 =
true
erewrite -> IHφ1, -> IHφ2; eauto .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (n : db_index) (x : evar ),
well_formed_positive φ1^{evar :n↦x} = true
→ well_formed_positive φ1 = trueIHφ2 : ∀ (n : db_index) (x : evar ),
well_formed_positive φ2^{evar :n↦x} = true
→ well_formed_positive φ2 = truen' : db_index x' : evar H : well_formed_positive (patt_imp φ1 φ2)^{evar :n'↦x'} =
true
well_formed_positive φ1 && well_formed_positive φ2 =
true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (n : db_index) (x : evar ),
well_formed_positive φ1^{evar :n↦x} = true
→ well_formed_positive φ1 = trueIHφ2 : ∀ (n : db_index) (x : evar ),
well_formed_positive φ2^{evar :n↦x} = true
→ well_formed_positive φ2 = truen' : db_index x' : evar H : well_formed_positive
φ1^[evar :n'↦patt_free_evar x'] &&
well_formed_positive
φ2^[evar :n'↦patt_free_evar x'] = true
well_formed_positive φ1 && well_formed_positive φ2 =
true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (n : db_index) (x : evar ),
well_formed_positive φ1^{evar :n↦x} = true
→ well_formed_positive φ1 = trueIHφ2 : ∀ (n : db_index) (x : evar ),
well_formed_positive φ2^{evar :n↦x} = true
→ well_formed_positive φ2 = truen' : db_index x' : evar E1 : well_formed_positive
φ1^[evar :n'↦patt_free_evar x'] = true E2 : well_formed_positive
φ2^[evar :n'↦patt_free_evar x'] = true
well_formed_positive φ1 && well_formed_positive φ2 =
true
erewrite -> IHφ1, -> IHφ2; eauto .
* Σ : Signature φ : Pattern IHφ : ∀ (n : db_index) (x : evar ),
well_formed_positive φ^{evar :n↦x} = true → well_formed_positive φ = truen' : db_index x' : evar H : well_formed_positive (patt_exists φ)^{evar :n'↦x'} =
true
well_formed_positive φ = true
simpl in H.Σ : Signature φ : Pattern IHφ : ∀ (n : db_index) (x : evar ),
well_formed_positive φ^{evar :n↦x} = true → well_formed_positive φ = truen' : db_index x' : evar H : well_formed_positive
φ^[evar :S n'↦patt_free_evar x'] = true
well_formed_positive φ = true
eapply IHφ; eauto .
* Σ : Signature φ : Pattern IHφ : ∀ (n : db_index) (x : evar ),
well_formed_positive φ^{evar :n↦x} = true → well_formed_positive φ = truen' : db_index x' : evar H : well_formed_positive (patt_mu φ)^{evar :n'↦x'} =
true
no_negative_occurrence_db_b 0 φ &&
well_formed_positive φ = true
simpl in H.Σ : Signature φ : Pattern IHφ : ∀ (n : db_index) (x : evar ),
well_formed_positive φ^{evar :n↦x} = true → well_formed_positive φ = truen' : db_index x' : evar H : no_negative_occurrence_db_b 0
φ^[evar :n'↦patt_free_evar x'] &&
well_formed_positive φ^[evar :n'↦patt_free_evar x'] =
true
no_negative_occurrence_db_b 0 φ &&
well_formed_positive φ = true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ : Pattern IHφ : ∀ (n : db_index) (x : evar ),
well_formed_positive φ^{evar :n↦x} = true → well_formed_positive φ = truen' : db_index x' : evar E1 : no_negative_occurrence_db_b 0
φ^[evar :n'↦patt_free_evar x'] = true E2 : well_formed_positive
φ^[evar :n'↦patt_free_evar x'] = true
no_negative_occurrence_db_b 0 φ &&
well_formed_positive φ = true
apply andb_true_iff.Σ : Signature φ : Pattern IHφ : ∀ (n : db_index) (x : evar ),
well_formed_positive φ^{evar :n↦x} = true → well_formed_positive φ = truen' : db_index x' : evar E1 : no_negative_occurrence_db_b 0
φ^[evar :n'↦patt_free_evar x'] = true E2 : well_formed_positive
φ^[evar :n'↦patt_free_evar x'] = true
no_negative_occurrence_db_b 0 φ = true
∧ well_formed_positive φ = true
split .Σ : Signature φ : Pattern IHφ : ∀ (n : db_index) (x : evar ),
well_formed_positive φ^{evar :n↦x} = true → well_formed_positive φ = truen' : db_index x' : evar E1 : no_negative_occurrence_db_b 0
φ^[evar :n'↦patt_free_evar x'] = true E2 : well_formed_positive
φ^[evar :n'↦patt_free_evar x'] = true
no_negative_occurrence_db_b 0 φ = true
eapply evar_open_no_negative_occurrence.Σ : Signature φ : Pattern IHφ : ∀ (n : db_index) (x : evar ),
well_formed_positive φ^{evar :n↦x} = true → well_formed_positive φ = truen' : db_index x' : evar E1 : no_negative_occurrence_db_b 0
φ^[evar :n'↦patt_free_evar x'] = true E2 : well_formed_positive
φ^[evar :n'↦patt_free_evar x'] = true
no_negative_occurrence_db_b 0 φ^{evar :?db2 ↦?x }
eassumption .Σ : Signature φ : Pattern IHφ : ∀ (n : db_index) (x : evar ),
well_formed_positive φ^{evar :n↦x} = true → well_formed_positive φ = truen' : db_index x' : evar E1 : no_negative_occurrence_db_b 0
φ^[evar :n'↦patt_free_evar x'] = true E2 : well_formed_positive
φ^[evar :n'↦patt_free_evar x'] = true
well_formed_positive φ = true
eapply IHφ; eauto .
Qed .
Lemma bevar_subst_closed_mu :
forall φ ψ n m ,
well_formed_closed_mu_aux φ m = true ->
well_formed_closed_mu_aux ψ m = true
->
well_formed_closed_mu_aux (φ^[evar : n ↦ ψ]) m = true.Σ : Signature
∀ (φ ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ^[evar :n↦ψ] m = true
Proof .Σ : Signature
∀ (φ ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ^[evar :n↦ψ] m = true
induction φ; intros ψ n' m H H0; cbn ; auto .Σ : Signature n : db_index ψ : Pattern n', m : db_index H : well_formed_closed_mu_aux (patt_bound_evar n) m =
true H0 : well_formed_closed_mu_aux ψ m = true
well_formed_closed_mu_aux
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end m = true
* Σ : Signature n : db_index ψ : Pattern n', m : db_index H : well_formed_closed_mu_aux (patt_bound_evar n) m =
true H0 : well_formed_closed_mu_aux ψ m = true
well_formed_closed_mu_aux
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end m = true
break_match_goal; simpl in H0, H; simpl ; auto .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ1 m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ1^[evar :n↦ψ] m =
trueIHφ2 : ∀ (ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ2 m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ2^[evar :n↦ψ] m =
trueψ : Pattern n', m : db_index H : well_formed_closed_mu_aux (patt_app φ1 φ2) m =
true H0 : well_formed_closed_mu_aux ψ m = true
well_formed_closed_mu_aux φ1^[evar :n'↦ψ] m &&
well_formed_closed_mu_aux φ2^[evar :n'↦ψ] m = true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ1 m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ1^[evar :n↦ψ] m =
trueIHφ2 : ∀ (ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ2 m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ2^[evar :n↦ψ] m =
trueψ : Pattern n', m : db_index H : well_formed_closed_mu_aux φ1 m &&
well_formed_closed_mu_aux φ2 m = true H0 : well_formed_closed_mu_aux ψ m = true
well_formed_closed_mu_aux φ1^[evar :n'↦ψ] m &&
well_formed_closed_mu_aux φ2^[evar :n'↦ψ] m = true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ1 m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ1^[evar :n↦ψ] m =
trueIHφ2 : ∀ (ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ2 m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ2^[evar :n↦ψ] m =
trueψ : Pattern n', m : db_index E1 : well_formed_closed_mu_aux φ1 m = true E2 : well_formed_closed_mu_aux φ2 m = true H0 : well_formed_closed_mu_aux ψ m = true
well_formed_closed_mu_aux φ1^[evar :n'↦ψ] m &&
well_formed_closed_mu_aux φ2^[evar :n'↦ψ] m = true
erewrite IHφ1, IHφ2; auto .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ1 m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ1^[evar :n↦ψ] m =
trueIHφ2 : ∀ (ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ2 m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ2^[evar :n↦ψ] m =
trueψ : Pattern n', m : db_index H : well_formed_closed_mu_aux (patt_imp φ1 φ2) m =
true H0 : well_formed_closed_mu_aux ψ m = true
well_formed_closed_mu_aux φ1^[evar :n'↦ψ] m &&
well_formed_closed_mu_aux φ2^[evar :n'↦ψ] m = true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ1 m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ1^[evar :n↦ψ] m =
trueIHφ2 : ∀ (ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ2 m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ2^[evar :n↦ψ] m =
trueψ : Pattern n', m : db_index H : well_formed_closed_mu_aux φ1 m &&
well_formed_closed_mu_aux φ2 m = true H0 : well_formed_closed_mu_aux ψ m = true
well_formed_closed_mu_aux φ1^[evar :n'↦ψ] m &&
well_formed_closed_mu_aux φ2^[evar :n'↦ψ] m = true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ1 m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ1^[evar :n↦ψ] m =
trueIHφ2 : ∀ (ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ2 m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ2^[evar :n↦ψ] m =
trueψ : Pattern n', m : db_index E1 : well_formed_closed_mu_aux φ1 m = true E2 : well_formed_closed_mu_aux φ2 m = true H0 : well_formed_closed_mu_aux ψ m = true
well_formed_closed_mu_aux φ1^[evar :n'↦ψ] m &&
well_formed_closed_mu_aux φ2^[evar :n'↦ψ] m = true
erewrite IHφ1, IHφ2; auto .
* Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ^[evar :n↦ψ] m = trueψ : Pattern n', m : db_index H : well_formed_closed_mu_aux (patt_mu φ) m = true H0 : well_formed_closed_mu_aux ψ m = true
well_formed_closed_mu_aux φ^[evar :n'↦ψ] (S m) = true
simpl in H.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ^[evar :n↦ψ] m = trueψ : Pattern n', m : db_index H : well_formed_closed_mu_aux φ (S m) = true H0 : well_formed_closed_mu_aux ψ m = true
well_formed_closed_mu_aux φ^[evar :n'↦ψ] (S m) = true
rewrite -> IHφ; auto .Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ^[evar :n↦ψ] m = trueψ : Pattern n', m : db_index H : well_formed_closed_mu_aux φ (S m) = true H0 : well_formed_closed_mu_aux ψ m = true
well_formed_closed_mu_aux ψ (S m) = true
eapply well_formed_closed_mu_aux_ind.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ^[evar :n↦ψ] m = trueψ : Pattern n', m : db_index H : well_formed_closed_mu_aux φ (S m) = true H0 : well_formed_closed_mu_aux ψ m = true
?ind_svar1 ≤ S m
2 : eassumption .Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n m : db_index),
well_formed_closed_mu_aux φ m = true
→ well_formed_closed_mu_aux ψ m = true
→ well_formed_closed_mu_aux φ^[evar :n↦ψ] m = trueψ : Pattern n', m : db_index H : well_formed_closed_mu_aux φ (S m) = true H0 : well_formed_closed_mu_aux ψ m = true
m ≤ S m
lia .
Qed .
Lemma bevar_subst_closed_ex :
forall φ ψ n ,
well_formed_closed_ex_aux φ (S n) = true ->
well_formed_closed_ex_aux ψ n = true
->
well_formed_closed_ex_aux (φ^[evar : n ↦ ψ]) n = true.Σ : Signature
∀ (φ ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ^[evar :n↦ψ] n = true
Proof .Σ : Signature
∀ (φ ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ^[evar :n↦ψ] n = true
induction φ; intros ψ n' H H0; cbn ; auto .Σ : Signature n : db_index ψ : Pattern n' : nat H : well_formed_closed_ex_aux (patt_bound_evar n)
(S n') = true H0 : well_formed_closed_ex_aux ψ n' = true
well_formed_closed_ex_aux
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end n' = true
* Σ : Signature n : db_index ψ : Pattern n' : nat H : well_formed_closed_ex_aux (patt_bound_evar n)
(S n') = true H0 : well_formed_closed_ex_aux ψ n' = true
well_formed_closed_ex_aux
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end n' = true
break_match_goal; simpl in H0, H; simpl ; auto . Σ : Signature n : db_index ψ : Pattern n' : nat H : (if decide (n < S n') then true else false) = true H0 : well_formed_closed_ex_aux ψ n' = true l : n < n' Heqc : compare_nat n n' = Nat_less n n' l
(if decide (n < n') then true else false) = true
repeat case_match; auto .Σ : Signature n : db_index ψ : Pattern n' : nat H : (if decide (n < S n') then true else false) = true H0 : well_formed_closed_ex_aux ψ n' = true g : n > n' Heqc : compare_nat n n' = Nat_greater n n' g
(if decide (Nat.pred n < n') then true else false) =
true
do 2 case_match; auto ; lia .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ1 (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ1^[evar :n↦ψ] n =
trueIHφ2 : ∀ (ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ2 (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ2^[evar :n↦ψ] n =
trueψ : Pattern n' : nat H : well_formed_closed_ex_aux (patt_app φ1 φ2) (S n') =
true H0 : well_formed_closed_ex_aux ψ n' = true
well_formed_closed_ex_aux φ1^[evar :n'↦ψ] n' &&
well_formed_closed_ex_aux φ2^[evar :n'↦ψ] n' = true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ1 (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ1^[evar :n↦ψ] n =
trueIHφ2 : ∀ (ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ2 (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ2^[evar :n↦ψ] n =
trueψ : Pattern n' : nat H : well_formed_closed_ex_aux φ1 (S n') &&
well_formed_closed_ex_aux φ2 (S n') = true H0 : well_formed_closed_ex_aux ψ n' = true
well_formed_closed_ex_aux φ1^[evar :n'↦ψ] n' &&
well_formed_closed_ex_aux φ2^[evar :n'↦ψ] n' = true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ1 (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ1^[evar :n↦ψ] n =
trueIHφ2 : ∀ (ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ2 (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ2^[evar :n↦ψ] n =
trueψ : Pattern n' : nat E1 : well_formed_closed_ex_aux φ1 (S n') = true E2 : well_formed_closed_ex_aux φ2 (S n') = true H0 : well_formed_closed_ex_aux ψ n' = true
well_formed_closed_ex_aux φ1^[evar :n'↦ψ] n' &&
well_formed_closed_ex_aux φ2^[evar :n'↦ψ] n' = true
erewrite IHφ1, IHφ2; auto .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ1 (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ1^[evar :n↦ψ] n =
trueIHφ2 : ∀ (ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ2 (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ2^[evar :n↦ψ] n =
trueψ : Pattern n' : nat H : well_formed_closed_ex_aux (patt_imp φ1 φ2) (S n') =
true H0 : well_formed_closed_ex_aux ψ n' = true
well_formed_closed_ex_aux φ1^[evar :n'↦ψ] n' &&
well_formed_closed_ex_aux φ2^[evar :n'↦ψ] n' = true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ1 (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ1^[evar :n↦ψ] n =
trueIHφ2 : ∀ (ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ2 (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ2^[evar :n↦ψ] n =
trueψ : Pattern n' : nat H : well_formed_closed_ex_aux φ1 (S n') &&
well_formed_closed_ex_aux φ2 (S n') = true H0 : well_formed_closed_ex_aux ψ n' = true
well_formed_closed_ex_aux φ1^[evar :n'↦ψ] n' &&
well_formed_closed_ex_aux φ2^[evar :n'↦ψ] n' = true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ1 (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ1^[evar :n↦ψ] n =
trueIHφ2 : ∀ (ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ2 (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ2^[evar :n↦ψ] n =
trueψ : Pattern n' : nat E1 : well_formed_closed_ex_aux φ1 (S n') = true E2 : well_formed_closed_ex_aux φ2 (S n') = true H0 : well_formed_closed_ex_aux ψ n' = true
well_formed_closed_ex_aux φ1^[evar :n'↦ψ] n' &&
well_formed_closed_ex_aux φ2^[evar :n'↦ψ] n' = true
erewrite IHφ1, IHφ2; auto .
* Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ^[evar :n↦ψ] n = trueψ : Pattern n' : nat H : well_formed_closed_ex_aux (patt_exists φ) (S n') =
true H0 : well_formed_closed_ex_aux ψ n' = true
well_formed_closed_ex_aux φ^[evar :S n'↦ψ] (S n') =
true
simpl in H.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ^[evar :n↦ψ] n = trueψ : Pattern n' : nat H : well_formed_closed_ex_aux φ (S (S n')) = true H0 : well_formed_closed_ex_aux ψ n' = true
well_formed_closed_ex_aux φ^[evar :S n'↦ψ] (S n') =
true
rewrite -> IHφ; auto .Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ^[evar :n↦ψ] n = trueψ : Pattern n' : nat H : well_formed_closed_ex_aux φ (S (S n')) = true H0 : well_formed_closed_ex_aux ψ n' = true
well_formed_closed_ex_aux ψ (S n') = true
eapply well_formed_closed_ex_aux_ind.Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ^[evar :n↦ψ] n = trueψ : Pattern n' : nat H : well_formed_closed_ex_aux φ (S (S n')) = true H0 : well_formed_closed_ex_aux ψ n' = true
?ind_evar1 ≤ S n'
2 : eassumption .Σ : Signature φ : Pattern IHφ : ∀ (ψ : Pattern) (n : nat),
well_formed_closed_ex_aux φ (S n) = true
→ well_formed_closed_ex_aux ψ n = true
→ well_formed_closed_ex_aux φ^[evar :n↦ψ] n = trueψ : Pattern n' : nat H : well_formed_closed_ex_aux φ (S (S n')) = true H0 : well_formed_closed_ex_aux ψ n' = true
n' ≤ S n'
lia .
Qed .
Lemma bevar_subst_positive :
forall φ ψ n , mu_free φ ->
well_formed_positive φ = true -> well_formed_positive ψ = true
->
well_formed_positive (φ^[evar : n ↦ ψ]) = true.Σ : Signature
∀ (φ ψ : Pattern) (n : db_index),
mu_free φ
→ well_formed_positive φ = true
→ well_formed_positive ψ = true
→ well_formed_positive φ^[evar :n↦ψ] = true
Proof .Σ : Signature
∀ (φ ψ : Pattern) (n : db_index),
mu_free φ
→ well_formed_positive φ = true
→ well_formed_positive ψ = true
→ well_formed_positive φ^[evar :n↦ψ] = true
induction φ; intros ψ n' H H0 H1; cbn ; auto .Σ : Signature n : db_index ψ : Pattern n' : db_index H : mu_free (patt_bound_evar n) H0 : well_formed_positive (patt_bound_evar n) = true H1 : well_formed_positive ψ = true
well_formed_positive
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = true
* Σ : Signature n : db_index ψ : Pattern n' : db_index H : mu_free (patt_bound_evar n) H0 : well_formed_positive (patt_bound_evar n) = true H1 : well_formed_positive ψ = true
well_formed_positive
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = true
break_match_goal; auto .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : db_index),
mu_free φ1
→ well_formed_positive φ1 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ1^[evar :n↦ψ] =
trueIHφ2 : ∀ (ψ : Pattern) (n : db_index),
mu_free φ2
→ well_formed_positive φ2 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ2^[evar :n↦ψ] =
trueψ : Pattern n' : db_index H : mu_free (patt_app φ1 φ2) H0 : well_formed_positive (patt_app φ1 φ2) = true H1 : well_formed_positive ψ = true
well_formed_positive φ1^[evar :n'↦ψ] &&
well_formed_positive φ2^[evar :n'↦ψ] = true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : db_index),
mu_free φ1
→ well_formed_positive φ1 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ1^[evar :n↦ψ] =
trueIHφ2 : ∀ (ψ : Pattern) (n : db_index),
mu_free φ2
→ well_formed_positive φ2 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ2^[evar :n↦ψ] =
trueψ : Pattern n' : db_index H : mu_free φ1 && mu_free φ2 H0 : well_formed_positive (patt_app φ1 φ2) = true H1 : well_formed_positive ψ = true
well_formed_positive φ1^[evar :n'↦ψ] &&
well_formed_positive φ2^[evar :n'↦ψ] = true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : db_index),
mu_free φ1
→ well_formed_positive φ1 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ1^[evar :n↦ψ] =
trueIHφ2 : ∀ (ψ : Pattern) (n : db_index),
mu_free φ2
→ well_formed_positive φ2 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ2^[evar :n↦ψ] =
trueψ : Pattern n' : db_index E1 : mu_free φ1 = true E2 : mu_free φ2 = true H0 : well_formed_positive (patt_app φ1 φ2) = true H1 : well_formed_positive ψ = true
well_formed_positive φ1^[evar :n'↦ψ] &&
well_formed_positive φ2^[evar :n'↦ψ] = true
apply andb_true_iff in H0 as [E1' E2'].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : db_index),
mu_free φ1
→ well_formed_positive φ1 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ1^[evar :n↦ψ] =
trueIHφ2 : ∀ (ψ : Pattern) (n : db_index),
mu_free φ2
→ well_formed_positive φ2 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ2^[evar :n↦ψ] =
trueψ : Pattern n' : db_index E1 : mu_free φ1 = true E2 : mu_free φ2 = true E1' : (fix well_formed_positive
(phi : Pattern) : bool :=
match phi with
| patt_app psi1 psi2 | patt_imp psi1 psi2 =>
well_formed_positive psi1 &&
well_formed_positive psi2
| patt_exists psi => well_formed_positive psi
| patt_mu psi =>
no_negative_occurrence_db_b 0 psi &&
well_formed_positive psi
| _ => true
end ) φ1 = true E2' : (fix well_formed_positive
(phi : Pattern) : bool :=
match phi with
| patt_app psi1 psi2 | patt_imp psi1 psi2 =>
well_formed_positive psi1 &&
well_formed_positive psi2
| patt_exists psi => well_formed_positive psi
| patt_mu psi =>
no_negative_occurrence_db_b 0 psi &&
well_formed_positive psi
| _ => true
end ) φ2 = true H1 : well_formed_positive ψ = true
well_formed_positive φ1^[evar :n'↦ψ] &&
well_formed_positive φ2^[evar :n'↦ψ] = true
rewrite -> IHφ1, -> IHφ2; auto .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : db_index),
mu_free φ1
→ well_formed_positive φ1 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ1^[evar :n↦ψ] =
trueIHφ2 : ∀ (ψ : Pattern) (n : db_index),
mu_free φ2
→ well_formed_positive φ2 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ2^[evar :n↦ψ] =
trueψ : Pattern n' : db_index H : mu_free (patt_imp φ1 φ2) H0 : well_formed_positive (patt_imp φ1 φ2) = true H1 : well_formed_positive ψ = true
well_formed_positive φ1^[evar :n'↦ψ] &&
well_formed_positive φ2^[evar :n'↦ψ] = true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : db_index),
mu_free φ1
→ well_formed_positive φ1 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ1^[evar :n↦ψ] =
trueIHφ2 : ∀ (ψ : Pattern) (n : db_index),
mu_free φ2
→ well_formed_positive φ2 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ2^[evar :n↦ψ] =
trueψ : Pattern n' : db_index H : mu_free φ1 && mu_free φ2 H0 : well_formed_positive (patt_imp φ1 φ2) = true H1 : well_formed_positive ψ = true
well_formed_positive φ1^[evar :n'↦ψ] &&
well_formed_positive φ2^[evar :n'↦ψ] = true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : db_index),
mu_free φ1
→ well_formed_positive φ1 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ1^[evar :n↦ψ] =
trueIHφ2 : ∀ (ψ : Pattern) (n : db_index),
mu_free φ2
→ well_formed_positive φ2 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ2^[evar :n↦ψ] =
trueψ : Pattern n' : db_index E1 : mu_free φ1 = true E2 : mu_free φ2 = true H0 : well_formed_positive (patt_imp φ1 φ2) = true H1 : well_formed_positive ψ = true
well_formed_positive φ1^[evar :n'↦ψ] &&
well_formed_positive φ2^[evar :n'↦ψ] = true
apply andb_true_iff in H0 as [E1' E2'].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (ψ : Pattern) (n : db_index),
mu_free φ1
→ well_formed_positive φ1 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ1^[evar :n↦ψ] =
trueIHφ2 : ∀ (ψ : Pattern) (n : db_index),
mu_free φ2
→ well_formed_positive φ2 = true
→ well_formed_positive ψ = true
→ well_formed_positive φ2^[evar :n↦ψ] =
trueψ : Pattern n' : db_index E1 : mu_free φ1 = true E2 : mu_free φ2 = true E1' : (fix well_formed_positive
(phi : Pattern) : bool :=
match phi with
| patt_app psi1 psi2 | patt_imp psi1 psi2 =>
well_formed_positive psi1 &&
well_formed_positive psi2
| patt_exists psi => well_formed_positive psi
| patt_mu psi =>
no_negative_occurrence_db_b 0 psi &&
well_formed_positive psi
| _ => true
end ) φ1 = true E2' : (fix well_formed_positive
(phi : Pattern) : bool :=
match phi with
| patt_app psi1 psi2 | patt_imp psi1 psi2 =>
well_formed_positive psi1 &&
well_formed_positive psi2
| patt_exists psi => well_formed_positive psi
| patt_mu psi =>
no_negative_occurrence_db_b 0 psi &&
well_formed_positive psi
| _ => true
end ) φ2 = true H1 : well_formed_positive ψ = true
well_formed_positive φ1^[evar :n'↦ψ] &&
well_formed_positive φ2^[evar :n'↦ψ] = true
now rewrite -> IHφ1, -> IHφ2.
Qed .
Theorem evar_quantify_closed_ex :
forall φ x n , well_formed_closed_ex_aux φ n ->
well_formed_closed_ex_aux (φ^{{evar : x ↦ n}}) (S n) = true.Σ : Signature
∀ (φ : Pattern) (x : evar ) (n : db_index),
well_formed_closed_ex_aux φ n
→ well_formed_closed_ex_aux φ^{{evar :x↦n}} (S n) =
true
Proof .Σ : Signature
∀ (φ : Pattern) (x : evar ) (n : db_index),
well_formed_closed_ex_aux φ n
→ well_formed_closed_ex_aux φ^{{evar :x↦n}} (S n) =
true
induction φ; intros x' n' H; cbn ; auto .Σ : Signature x, x' : evar n' : db_index H : well_formed_closed_ex_aux (patt_free_evar x) n'
well_formed_closed_ex_aux
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x) (S n') = true
* Σ : Signature x, x' : evar n' : db_index H : well_formed_closed_ex_aux (patt_free_evar x) n'
well_formed_closed_ex_aux
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x) (S n') = true
destruct (decide (x' = x)); simpl ; auto .Σ : Signature x, x' : evar n' : db_index H : well_formed_closed_ex_aux (patt_free_evar x) n' e : x' = x
(if decide (n' < S n') then true else false) = true
case_match; try lia .
* Σ : Signature n : db_index x' : evar n' : db_index H : well_formed_closed_ex_aux (patt_bound_evar n) n'
(if decide (n < S n') then true else false) = true
simpl in H.Σ : Signature n : db_index x' : evar n' : db_index H : if decide (n < n') then true else false
(if decide (n < S n') then true else false) = true
repeat case_match; auto ; lia .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
well_formed_closed_ex_aux φ1 n
→ well_formed_closed_ex_aux φ1^{{evar :x↦n}}
(S n) = trueIHφ2 : ∀ (x : evar ) (n : db_index),
well_formed_closed_ex_aux φ2 n
→ well_formed_closed_ex_aux φ2^{{evar :x↦n}}
(S n) = truex' : evar n' : db_index H : well_formed_closed_ex_aux (patt_app φ1 φ2) n'
well_formed_closed_ex_aux φ1^{{evar :x'↦n'}} (S n') &&
well_formed_closed_ex_aux φ2^{{evar :x'↦n'}} (S n') =
true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
well_formed_closed_ex_aux φ1 n
→ well_formed_closed_ex_aux φ1^{{evar :x↦n}}
(S n) = trueIHφ2 : ∀ (x : evar ) (n : db_index),
well_formed_closed_ex_aux φ2 n
→ well_formed_closed_ex_aux φ2^{{evar :x↦n}}
(S n) = truex' : evar n' : db_index H : well_formed_closed_ex_aux φ1 n' &&
well_formed_closed_ex_aux φ2 n'
well_formed_closed_ex_aux φ1^{{evar :x'↦n'}} (S n') &&
well_formed_closed_ex_aux φ2^{{evar :x'↦n'}} (S n') =
true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
well_formed_closed_ex_aux φ1 n
→ well_formed_closed_ex_aux φ1^{{evar :x↦n}}
(S n) = trueIHφ2 : ∀ (x : evar ) (n : db_index),
well_formed_closed_ex_aux φ2 n
→ well_formed_closed_ex_aux φ2^{{evar :x↦n}}
(S n) = truex' : evar n' : db_index E1 : well_formed_closed_ex_aux φ1 n' = true E2 : well_formed_closed_ex_aux φ2 n' = true
well_formed_closed_ex_aux φ1^{{evar :x'↦n'}} (S n') &&
well_formed_closed_ex_aux φ2^{{evar :x'↦n'}} (S n') =
true
now rewrite -> IHφ1, -> IHφ2.
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
well_formed_closed_ex_aux φ1 n
→ well_formed_closed_ex_aux φ1^{{evar :x↦n}}
(S n) = trueIHφ2 : ∀ (x : evar ) (n : db_index),
well_formed_closed_ex_aux φ2 n
→ well_formed_closed_ex_aux φ2^{{evar :x↦n}}
(S n) = truex' : evar n' : db_index H : well_formed_closed_ex_aux (patt_imp φ1 φ2) n'
well_formed_closed_ex_aux φ1^{{evar :x'↦n'}} (S n') &&
well_formed_closed_ex_aux φ2^{{evar :x'↦n'}} (S n') =
true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
well_formed_closed_ex_aux φ1 n
→ well_formed_closed_ex_aux φ1^{{evar :x↦n}}
(S n) = trueIHφ2 : ∀ (x : evar ) (n : db_index),
well_formed_closed_ex_aux φ2 n
→ well_formed_closed_ex_aux φ2^{{evar :x↦n}}
(S n) = truex' : evar n' : db_index H : well_formed_closed_ex_aux φ1 n' &&
well_formed_closed_ex_aux φ2 n'
well_formed_closed_ex_aux φ1^{{evar :x'↦n'}} (S n') &&
well_formed_closed_ex_aux φ2^{{evar :x'↦n'}} (S n') =
true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
well_formed_closed_ex_aux φ1 n
→ well_formed_closed_ex_aux φ1^{{evar :x↦n}}
(S n) = trueIHφ2 : ∀ (x : evar ) (n : db_index),
well_formed_closed_ex_aux φ2 n
→ well_formed_closed_ex_aux φ2^{{evar :x↦n}}
(S n) = truex' : evar n' : db_index E1 : well_formed_closed_ex_aux φ1 n' = true E2 : well_formed_closed_ex_aux φ2 n' = true
well_formed_closed_ex_aux φ1^{{evar :x'↦n'}} (S n') &&
well_formed_closed_ex_aux φ2^{{evar :x'↦n'}} (S n') =
true
now rewrite -> IHφ1, -> IHφ2.
Qed .
Theorem svar_quantify_closed_mu :
forall φ X n , well_formed_closed_mu_aux φ n ->
well_formed_closed_mu_aux (φ^{{svar: X ↦ n}}) (S n) = true.Σ : Signature
∀ (φ : Pattern) (X : svar) (n : db_index),
well_formed_closed_mu_aux φ n
→ well_formed_closed_mu_aux φ^{{svar:X↦n}} (S n) =
true
Proof .Σ : Signature
∀ (φ : Pattern) (X : svar) (n : db_index),
well_formed_closed_mu_aux φ n
→ well_formed_closed_mu_aux φ^{{svar:X↦n}} (S n) =
true
induction φ; intros x' n' H; cbn ; auto .Σ : Signature x, x' : svar n' : db_index H : well_formed_closed_mu_aux (patt_free_svar x) n'
well_formed_closed_mu_aux
(if decide (x' = x)
then patt_bound_svar n'
else patt_free_svar x) (S n') = true
* Σ : Signature x, x' : svar n' : db_index H : well_formed_closed_mu_aux (patt_free_svar x) n'
well_formed_closed_mu_aux
(if decide (x' = x)
then patt_bound_svar n'
else patt_free_svar x) (S n') = true
destruct (decide (x' = x)); simpl ; auto .Σ : Signature x, x' : svar n' : db_index H : well_formed_closed_mu_aux (patt_free_svar x) n' e : x' = x
(if decide (n' < S n') then true else false) = true
case_match; try lia .
* Σ : Signature n : db_index x' : svar n' : db_index H : well_formed_closed_mu_aux (patt_bound_svar n) n'
(if decide (n < S n') then true else false) = true
simpl in H.Σ : Signature n : db_index x' : svar n' : db_index H : if decide (n < n') then true else false
(if decide (n < S n') then true else false) = true
repeat case_match; auto ; lia .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n : db_index),
well_formed_closed_mu_aux φ1 n
→ well_formed_closed_mu_aux φ1^{{svar:X↦n}}
(S n) = trueIHφ2 : ∀ (X : svar) (n : db_index),
well_formed_closed_mu_aux φ2 n
→ well_formed_closed_mu_aux φ2^{{svar:X↦n}}
(S n) = truex' : svar n' : db_index H : well_formed_closed_mu_aux (patt_app φ1 φ2) n'
well_formed_closed_mu_aux φ1^{{svar:x'↦n'}} (S n') &&
well_formed_closed_mu_aux φ2^{{svar:x'↦n'}} (S n') =
true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n : db_index),
well_formed_closed_mu_aux φ1 n
→ well_formed_closed_mu_aux φ1^{{svar:X↦n}}
(S n) = trueIHφ2 : ∀ (X : svar) (n : db_index),
well_formed_closed_mu_aux φ2 n
→ well_formed_closed_mu_aux φ2^{{svar:X↦n}}
(S n) = truex' : svar n' : db_index H : well_formed_closed_mu_aux φ1 n' &&
well_formed_closed_mu_aux φ2 n'
well_formed_closed_mu_aux φ1^{{svar:x'↦n'}} (S n') &&
well_formed_closed_mu_aux φ2^{{svar:x'↦n'}} (S n') =
true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n : db_index),
well_formed_closed_mu_aux φ1 n
→ well_formed_closed_mu_aux φ1^{{svar:X↦n}}
(S n) = trueIHφ2 : ∀ (X : svar) (n : db_index),
well_formed_closed_mu_aux φ2 n
→ well_formed_closed_mu_aux φ2^{{svar:X↦n}}
(S n) = truex' : svar n' : db_index E1 : well_formed_closed_mu_aux φ1 n' = true E2 : well_formed_closed_mu_aux φ2 n' = true
well_formed_closed_mu_aux φ1^{{svar:x'↦n'}} (S n') &&
well_formed_closed_mu_aux φ2^{{svar:x'↦n'}} (S n') =
true
now rewrite -> IHφ1, -> IHφ2.
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n : db_index),
well_formed_closed_mu_aux φ1 n
→ well_formed_closed_mu_aux φ1^{{svar:X↦n}}
(S n) = trueIHφ2 : ∀ (X : svar) (n : db_index),
well_formed_closed_mu_aux φ2 n
→ well_formed_closed_mu_aux φ2^{{svar:X↦n}}
(S n) = truex' : svar n' : db_index H : well_formed_closed_mu_aux (patt_imp φ1 φ2) n'
well_formed_closed_mu_aux φ1^{{svar:x'↦n'}} (S n') &&
well_formed_closed_mu_aux φ2^{{svar:x'↦n'}} (S n') =
true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n : db_index),
well_formed_closed_mu_aux φ1 n
→ well_formed_closed_mu_aux φ1^{{svar:X↦n}}
(S n) = trueIHφ2 : ∀ (X : svar) (n : db_index),
well_formed_closed_mu_aux φ2 n
→ well_formed_closed_mu_aux φ2^{{svar:X↦n}}
(S n) = truex' : svar n' : db_index H : well_formed_closed_mu_aux φ1 n' &&
well_formed_closed_mu_aux φ2 n'
well_formed_closed_mu_aux φ1^{{svar:x'↦n'}} (S n') &&
well_formed_closed_mu_aux φ2^{{svar:x'↦n'}} (S n') =
true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n : db_index),
well_formed_closed_mu_aux φ1 n
→ well_formed_closed_mu_aux φ1^{{svar:X↦n}}
(S n) = trueIHφ2 : ∀ (X : svar) (n : db_index),
well_formed_closed_mu_aux φ2 n
→ well_formed_closed_mu_aux φ2^{{svar:X↦n}}
(S n) = truex' : svar n' : db_index E1 : well_formed_closed_mu_aux φ1 n' = true E2 : well_formed_closed_mu_aux φ2 n' = true
well_formed_closed_mu_aux φ1^{{svar:x'↦n'}} (S n') &&
well_formed_closed_mu_aux φ2^{{svar:x'↦n'}} (S n') =
true
now rewrite -> IHφ1, -> IHφ2.
Qed .
Theorem evar_quantify_closed_mu :
forall φ x n m , well_formed_closed_mu_aux φ m ->
well_formed_closed_mu_aux (φ^{{evar : x ↦ n}}) m = true.Σ : Signature
∀ (φ : Pattern) (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ m
→ well_formed_closed_mu_aux φ^{{evar :x↦n}} m = true
Proof .Σ : Signature
∀ (φ : Pattern) (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ m
→ well_formed_closed_mu_aux φ^{{evar :x↦n}} m = true
induction φ; intros x' n' m H; cbn ; auto .Σ : Signature x, x' : evar n', m : db_index H : well_formed_closed_mu_aux (patt_free_evar x) m
well_formed_closed_mu_aux
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x) m = true
- Σ : Signature x, x' : evar n', m : db_index H : well_formed_closed_mu_aux (patt_free_evar x) m
well_formed_closed_mu_aux
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x) m = true
destruct (decide (x' = x)); simpl ; auto .
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ1 m
→ well_formed_closed_mu_aux φ1^{{evar :x↦n}} m =
trueIHφ2 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ2 m
→ well_formed_closed_mu_aux φ2^{{evar :x↦n}} m =
truex' : evar n', m : db_index H : well_formed_closed_mu_aux (patt_app φ1 φ2) m
well_formed_closed_mu_aux φ1^{{evar :x'↦n'}} m &&
well_formed_closed_mu_aux φ2^{{evar :x'↦n'}} m = true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ1 m
→ well_formed_closed_mu_aux φ1^{{evar :x↦n}} m =
trueIHφ2 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ2 m
→ well_formed_closed_mu_aux φ2^{{evar :x↦n}} m =
truex' : evar n', m : db_index H : well_formed_closed_mu_aux φ1 m &&
well_formed_closed_mu_aux φ2 m
well_formed_closed_mu_aux φ1^{{evar :x'↦n'}} m &&
well_formed_closed_mu_aux φ2^{{evar :x'↦n'}} m = true
repeat case_match; auto .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ1 m
→ well_formed_closed_mu_aux φ1^{{evar :x↦n}} m =
trueIHφ2 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ2 m
→ well_formed_closed_mu_aux φ2^{{evar :x↦n}} m =
truex' : evar n', m : db_index H : well_formed_closed_mu_aux φ1 m &&
well_formed_closed_mu_aux φ2 m
well_formed_closed_mu_aux φ1^{{evar :x'↦n'}} m &&
well_formed_closed_mu_aux φ2^{{evar :x'↦n'}} m = true
destruct_and!. Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ1 m
→ well_formed_closed_mu_aux φ1^{{evar :x↦n}} m =
trueIHφ2 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ2 m
→ well_formed_closed_mu_aux φ2^{{evar :x↦n}} m =
truex' : evar n', m : db_index H0 : well_formed_closed_mu_aux φ1 m = true H1 : well_formed_closed_mu_aux φ2 m = true
well_formed_closed_mu_aux φ1^{{evar :x'↦n'}} m &&
well_formed_closed_mu_aux φ2^{{evar :x'↦n'}} m = true
split_and!. Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ1 m
→ well_formed_closed_mu_aux φ1^{{evar :x↦n}} m =
trueIHφ2 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ2 m
→ well_formed_closed_mu_aux φ2^{{evar :x↦n}} m =
truex' : evar n', m : db_index H0 : well_formed_closed_mu_aux φ1 m = true H1 : well_formed_closed_mu_aux φ2 m = true
well_formed_closed_mu_aux φ1^{{evar :x'↦n'}} m = true
+ Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ1 m
→ well_formed_closed_mu_aux φ1^{{evar :x↦n}} m =
trueIHφ2 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ2 m
→ well_formed_closed_mu_aux φ2^{{evar :x↦n}} m =
truex' : evar n', m : db_index H0 : well_formed_closed_mu_aux φ1 m = true H1 : well_formed_closed_mu_aux φ2 m = true
well_formed_closed_mu_aux φ1^{{evar :x'↦n'}} m = true
apply IHφ1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ1 m
→ well_formed_closed_mu_aux φ1^{{evar :x↦n}} m =
trueIHφ2 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ2 m
→ well_formed_closed_mu_aux φ2^{{evar :x↦n}} m =
truex' : evar n', m : db_index H0 : well_formed_closed_mu_aux φ1 m = true H1 : well_formed_closed_mu_aux φ2 m = true
well_formed_closed_mu_aux φ1 m
assumption .
+ Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ1 m
→ well_formed_closed_mu_aux φ1^{{evar :x↦n}} m =
trueIHφ2 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ2 m
→ well_formed_closed_mu_aux φ2^{{evar :x↦n}} m =
truex' : evar n', m : db_index H0 : well_formed_closed_mu_aux φ1 m = true H1 : well_formed_closed_mu_aux φ2 m = true
well_formed_closed_mu_aux φ2^{{evar :x'↦n'}} m = true
apply IHφ2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ1 m
→ well_formed_closed_mu_aux φ1^{{evar :x↦n}} m =
trueIHφ2 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ2 m
→ well_formed_closed_mu_aux φ2^{{evar :x↦n}} m =
truex' : evar n', m : db_index H0 : well_formed_closed_mu_aux φ1 m = true H1 : well_formed_closed_mu_aux φ2 m = true
well_formed_closed_mu_aux φ2 m
assumption .
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ1 m
→ well_formed_closed_mu_aux φ1^{{evar :x↦n}} m =
trueIHφ2 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ2 m
→ well_formed_closed_mu_aux φ2^{{evar :x↦n}} m =
truex' : evar n', m : db_index H : well_formed_closed_mu_aux (patt_imp φ1 φ2) m
well_formed_closed_mu_aux φ1^{{evar :x'↦n'}} m &&
well_formed_closed_mu_aux φ2^{{evar :x'↦n'}} m = true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ1 m
→ well_formed_closed_mu_aux φ1^{{evar :x↦n}} m =
trueIHφ2 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ2 m
→ well_formed_closed_mu_aux φ2^{{evar :x↦n}} m =
truex' : evar n', m : db_index H : well_formed_closed_mu_aux φ1 m &&
well_formed_closed_mu_aux φ2 m
well_formed_closed_mu_aux φ1^{{evar :x'↦n'}} m &&
well_formed_closed_mu_aux φ2^{{evar :x'↦n'}} m = true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ1 m
→ well_formed_closed_mu_aux φ1^{{evar :x↦n}} m =
trueIHφ2 : ∀ (x : evar ) (n m : db_index),
well_formed_closed_mu_aux φ2 m
→ well_formed_closed_mu_aux φ2^{{evar :x↦n}} m =
truex' : evar n', m : db_index E1 : well_formed_closed_mu_aux φ1 m = true E2 : well_formed_closed_mu_aux φ2 m = true
well_formed_closed_mu_aux φ1^{{evar :x'↦n'}} m &&
well_formed_closed_mu_aux φ2^{{evar :x'↦n'}} m = true
now rewrite -> IHφ1, -> IHφ2.
Qed .
Theorem svar_quantify_closed_ex :
forall φ X n m , well_formed_closed_ex_aux φ m ->
well_formed_closed_ex_aux (φ^{{svar: X ↦ n}}) m = true.Σ : Signature
∀ (φ : Pattern) (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ m
→ well_formed_closed_ex_aux φ^{{svar:X↦n}} m = true
Proof .Σ : Signature
∀ (φ : Pattern) (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ m
→ well_formed_closed_ex_aux φ^{{svar:X↦n}} m = true
induction φ; intros x' n' m H; cbn ; auto .Σ : Signature x, x' : svar n', m : db_index H : well_formed_closed_ex_aux (patt_free_svar x) m
well_formed_closed_ex_aux
(if decide (x' = x)
then patt_bound_svar n'
else patt_free_svar x) m = true
- Σ : Signature x, x' : svar n', m : db_index H : well_formed_closed_ex_aux (patt_free_svar x) m
well_formed_closed_ex_aux
(if decide (x' = x)
then patt_bound_svar n'
else patt_free_svar x) m = true
destruct (decide (x' = x)); simpl ; auto .
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ1 m
→ well_formed_closed_ex_aux φ1^{{svar:X↦n}} m =
trueIHφ2 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ2 m
→ well_formed_closed_ex_aux φ2^{{svar:X↦n}} m =
truex' : svar n', m : db_index H : well_formed_closed_ex_aux (patt_app φ1 φ2) m
well_formed_closed_ex_aux φ1^{{svar:x'↦n'}} m &&
well_formed_closed_ex_aux φ2^{{svar:x'↦n'}} m = true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ1 m
→ well_formed_closed_ex_aux φ1^{{svar:X↦n}} m =
trueIHφ2 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ2 m
→ well_formed_closed_ex_aux φ2^{{svar:X↦n}} m =
truex' : svar n', m : db_index H : well_formed_closed_ex_aux φ1 m &&
well_formed_closed_ex_aux φ2 m
well_formed_closed_ex_aux φ1^{{svar:x'↦n'}} m &&
well_formed_closed_ex_aux φ2^{{svar:x'↦n'}} m = true
repeat case_match; auto .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ1 m
→ well_formed_closed_ex_aux φ1^{{svar:X↦n}} m =
trueIHφ2 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ2 m
→ well_formed_closed_ex_aux φ2^{{svar:X↦n}} m =
truex' : svar n', m : db_index H : well_formed_closed_ex_aux φ1 m &&
well_formed_closed_ex_aux φ2 m
well_formed_closed_ex_aux φ1^{{svar:x'↦n'}} m &&
well_formed_closed_ex_aux φ2^{{svar:x'↦n'}} m = true
destruct_and!. Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ1 m
→ well_formed_closed_ex_aux φ1^{{svar:X↦n}} m =
trueIHφ2 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ2 m
→ well_formed_closed_ex_aux φ2^{{svar:X↦n}} m =
truex' : svar n', m : db_index H0 : well_formed_closed_ex_aux φ1 m = true H1 : well_formed_closed_ex_aux φ2 m = true
well_formed_closed_ex_aux φ1^{{svar:x'↦n'}} m &&
well_formed_closed_ex_aux φ2^{{svar:x'↦n'}} m = true
split_and!. Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ1 m
→ well_formed_closed_ex_aux φ1^{{svar:X↦n}} m =
trueIHφ2 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ2 m
→ well_formed_closed_ex_aux φ2^{{svar:X↦n}} m =
truex' : svar n', m : db_index H0 : well_formed_closed_ex_aux φ1 m = true H1 : well_formed_closed_ex_aux φ2 m = true
well_formed_closed_ex_aux φ1^{{svar:x'↦n'}} m = true
+ Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ1 m
→ well_formed_closed_ex_aux φ1^{{svar:X↦n}} m =
trueIHφ2 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ2 m
→ well_formed_closed_ex_aux φ2^{{svar:X↦n}} m =
truex' : svar n', m : db_index H0 : well_formed_closed_ex_aux φ1 m = true H1 : well_formed_closed_ex_aux φ2 m = true
well_formed_closed_ex_aux φ1^{{svar:x'↦n'}} m = true
apply IHφ1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ1 m
→ well_formed_closed_ex_aux φ1^{{svar:X↦n}} m =
trueIHφ2 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ2 m
→ well_formed_closed_ex_aux φ2^{{svar:X↦n}} m =
truex' : svar n', m : db_index H0 : well_formed_closed_ex_aux φ1 m = true H1 : well_formed_closed_ex_aux φ2 m = true
well_formed_closed_ex_aux φ1 m
assumption .
+ Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ1 m
→ well_formed_closed_ex_aux φ1^{{svar:X↦n}} m =
trueIHφ2 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ2 m
→ well_formed_closed_ex_aux φ2^{{svar:X↦n}} m =
truex' : svar n', m : db_index H0 : well_formed_closed_ex_aux φ1 m = true H1 : well_formed_closed_ex_aux φ2 m = true
well_formed_closed_ex_aux φ2^{{svar:x'↦n'}} m = true
apply IHφ2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ1 m
→ well_formed_closed_ex_aux φ1^{{svar:X↦n}} m =
trueIHφ2 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ2 m
→ well_formed_closed_ex_aux φ2^{{svar:X↦n}} m =
truex' : svar n', m : db_index H0 : well_formed_closed_ex_aux φ1 m = true H1 : well_formed_closed_ex_aux φ2 m = true
well_formed_closed_ex_aux φ2 m
assumption .
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ1 m
→ well_formed_closed_ex_aux φ1^{{svar:X↦n}} m =
trueIHφ2 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ2 m
→ well_formed_closed_ex_aux φ2^{{svar:X↦n}} m =
truex' : svar n', m : db_index H : well_formed_closed_ex_aux (patt_imp φ1 φ2) m
well_formed_closed_ex_aux φ1^{{svar:x'↦n'}} m &&
well_formed_closed_ex_aux φ2^{{svar:x'↦n'}} m = true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ1 m
→ well_formed_closed_ex_aux φ1^{{svar:X↦n}} m =
trueIHφ2 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ2 m
→ well_formed_closed_ex_aux φ2^{{svar:X↦n}} m =
truex' : svar n', m : db_index H : well_formed_closed_ex_aux φ1 m &&
well_formed_closed_ex_aux φ2 m
well_formed_closed_ex_aux φ1^{{svar:x'↦n'}} m &&
well_formed_closed_ex_aux φ2^{{svar:x'↦n'}} m = true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ1 m
→ well_formed_closed_ex_aux φ1^{{svar:X↦n}} m =
trueIHφ2 : ∀ (X : svar) (n m : db_index),
well_formed_closed_ex_aux φ2 m
→ well_formed_closed_ex_aux φ2^{{svar:X↦n}} m =
truex' : svar n', m : db_index E1 : well_formed_closed_ex_aux φ1 m = true E2 : well_formed_closed_ex_aux φ2 m = true
well_formed_closed_ex_aux φ1^{{svar:x'↦n'}} m &&
well_formed_closed_ex_aux φ2^{{svar:x'↦n'}} m = true
now rewrite -> IHφ1, -> IHφ2.
Qed .
Theorem no_occ_quantify :
∀ (φ : Pattern) (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1 φ
→ no_negative_occurrence_db_b db1 (φ^{{evar : x ↦ db2}}))
∧ (no_positive_occurrence_db_b db1 φ
→ no_positive_occurrence_db_b db1 (φ^{{evar : x ↦ db2}})).Σ : Signature
∀ (φ : Pattern) (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1 φ
→ no_negative_occurrence_db_b db1 φ^{{evar :x↦db2}})
∧ (no_positive_occurrence_db_b db1 φ
→ no_positive_occurrence_db_b db1
φ^{{evar :x↦db2}})
Proof .Σ : Signature
∀ (φ : Pattern) (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1 φ
→ no_negative_occurrence_db_b db1 φ^{{evar :x↦db2}})
∧ (no_positive_occurrence_db_b db1 φ
→ no_positive_occurrence_db_b db1
φ^{{evar :x↦db2}})
induction φ; split ; intros H; cbn ; auto .Σ : Signature x : evar db1, db2 : db_index x0 : evar H : no_negative_occurrence_db_b db1 (patt_free_evar x)
no_negative_occurrence_db_b db1
(if decide (x0 = x)
then patt_bound_evar db2
else patt_free_evar x)
1 -2 : destruct (decide (x0 = x)); simpl ; auto .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1 φ1
→ no_negative_occurrence_db_b db1
φ1^{{evar :x↦db2}})
∧ (no_positive_occurrence_db_b db1 φ1
→ no_positive_occurrence_db_b db1
φ1^{{evar :x↦db2}})IHφ2 : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1 φ2
→ no_negative_occurrence_db_b db1
φ2^{{evar :x↦db2}})
∧ (no_positive_occurrence_db_b db1 φ2
→ no_positive_occurrence_db_b db1
φ2^{{evar :x↦db2}})db1, db2 : db_index x : evar H : no_negative_occurrence_db_b db1 (patt_app φ1 φ2)
no_negative_occurrence_db_b db1 φ1^{{evar :x↦db2}} &&
no_negative_occurrence_db_b db1 φ2^{{evar :x↦db2}}
1 -4 : simpl in H; apply andb_true_iff in H as [E1 E2];
specialize (IHφ1 db1 db2 x) as [IH1 IH2];
specialize (IHφ2 db1 db2 x) as [IH1' IH2'];
try rewrite -> IH1; try rewrite -> IH1';
try rewrite -> IH2; try rewrite -> IH2'; auto .Σ : Signature φ : Pattern IHφ : ∀ (db1 db2 : db_index) (x : evar ),
(no_negative_occurrence_db_b db1 φ
→ no_negative_occurrence_db_b db1 φ^{{evar :x↦db2}})
∧ (no_positive_occurrence_db_b db1 φ
→ no_positive_occurrence_db_b db1 φ^{{evar :x↦db2}})db1, db2 : db_index x : evar H : no_negative_occurrence_db_b db1 (patt_exists φ)
no_negative_occurrence_db_b db1 φ^{{evar :x↦S db2}}
1 -4 : simpl in H; now apply IHφ.
Qed .
Theorem evar_quantify_positive :
forall φ x n , well_formed_positive φ ->
well_formed_positive (φ^{{evar : x ↦ n}}) = true.Σ : Signature
∀ (φ : Pattern) (x : evar ) (n : db_index),
well_formed_positive φ
→ well_formed_positive φ^{{evar :x↦n}} = true
Proof .Σ : Signature
∀ (φ : Pattern) (x : evar ) (n : db_index),
well_formed_positive φ
→ well_formed_positive φ^{{evar :x↦n}} = true
induction φ; intros x' n' H; cbn ; auto .Σ : Signature x, x' : evar n' : db_index H : well_formed_positive (patt_free_evar x)
well_formed_positive
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x) = true
* Σ : Signature x, x' : evar n' : db_index H : well_formed_positive (patt_free_evar x)
well_formed_positive
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x) = true
destruct (decide (x' = x)); simpl ; auto .
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
well_formed_positive φ1
→ well_formed_positive φ1^{{evar :x↦n}} = trueIHφ2 : ∀ (x : evar ) (n : db_index),
well_formed_positive φ2
→ well_formed_positive φ2^{{evar :x↦n}} = truex' : evar n' : db_index H : well_formed_positive (patt_app φ1 φ2)
well_formed_positive φ1^{{evar :x'↦n'}} &&
well_formed_positive φ2^{{evar :x'↦n'}} = true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
well_formed_positive φ1
→ well_formed_positive φ1^{{evar :x↦n}} = trueIHφ2 : ∀ (x : evar ) (n : db_index),
well_formed_positive φ2
→ well_formed_positive φ2^{{evar :x↦n}} = truex' : evar n' : db_index H : well_formed_positive φ1 && well_formed_positive φ2
well_formed_positive φ1^{{evar :x'↦n'}} &&
well_formed_positive φ2^{{evar :x'↦n'}} = true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
well_formed_positive φ1
→ well_formed_positive φ1^{{evar :x↦n}} = trueIHφ2 : ∀ (x : evar ) (n : db_index),
well_formed_positive φ2
→ well_formed_positive φ2^{{evar :x↦n}} = truex' : evar n' : db_index E1 : well_formed_positive φ1 = true E2 : well_formed_positive φ2 = true
well_formed_positive φ1^{{evar :x'↦n'}} &&
well_formed_positive φ2^{{evar :x'↦n'}} = true
now rewrite -> IHφ1, -> IHφ2.
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
well_formed_positive φ1
→ well_formed_positive φ1^{{evar :x↦n}} = trueIHφ2 : ∀ (x : evar ) (n : db_index),
well_formed_positive φ2
→ well_formed_positive φ2^{{evar :x↦n}} = truex' : evar n' : db_index H : well_formed_positive (patt_imp φ1 φ2)
well_formed_positive φ1^{{evar :x'↦n'}} &&
well_formed_positive φ2^{{evar :x'↦n'}} = true
simpl in H.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
well_formed_positive φ1
→ well_formed_positive φ1^{{evar :x↦n}} = trueIHφ2 : ∀ (x : evar ) (n : db_index),
well_formed_positive φ2
→ well_formed_positive φ2^{{evar :x↦n}} = truex' : evar n' : db_index H : well_formed_positive φ1 && well_formed_positive φ2
well_formed_positive φ1^{{evar :x'↦n'}} &&
well_formed_positive φ2^{{evar :x'↦n'}} = true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
well_formed_positive φ1
→ well_formed_positive φ1^{{evar :x↦n}} = trueIHφ2 : ∀ (x : evar ) (n : db_index),
well_formed_positive φ2
→ well_formed_positive φ2^{{evar :x↦n}} = truex' : evar n' : db_index E1 : well_formed_positive φ1 = true E2 : well_formed_positive φ2 = true
well_formed_positive φ1^{{evar :x'↦n'}} &&
well_formed_positive φ2^{{evar :x'↦n'}} = true
now rewrite -> IHφ1, -> IHφ2.
* Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index),
well_formed_positive φ → well_formed_positive φ^{{evar :x↦n}} = truex' : evar n' : db_index H : well_formed_positive (patt_mu φ)
no_negative_occurrence_db_b 0 φ^{{evar :x'↦n'}} &&
well_formed_positive φ^{{evar :x'↦n'}} = true
simpl in H.Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index),
well_formed_positive φ → well_formed_positive φ^{{evar :x↦n}} = truex' : evar n' : db_index H : no_negative_occurrence_db_b 0 φ &&
well_formed_positive φ
no_negative_occurrence_db_b 0 φ^{{evar :x'↦n'}} &&
well_formed_positive φ^{{evar :x'↦n'}} = true
apply andb_true_iff in H as [E1 E2].Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index),
well_formed_positive φ → well_formed_positive φ^{{evar :x↦n}} = truex' : evar n' : db_index E1 : no_negative_occurrence_db_b 0 φ = true E2 : well_formed_positive φ = true
no_negative_occurrence_db_b 0 φ^{{evar :x'↦n'}} &&
well_formed_positive φ^{{evar :x'↦n'}} = true
apply andb_true_iff.Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index),
well_formed_positive φ → well_formed_positive φ^{{evar :x↦n}} = truex' : evar n' : db_index E1 : no_negative_occurrence_db_b 0 φ = true E2 : well_formed_positive φ = true
no_negative_occurrence_db_b 0 φ^{{evar :x'↦n'}} = true
∧ well_formed_positive φ^{{evar :x'↦n'}} = true
split .Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index),
well_formed_positive φ → well_formed_positive φ^{{evar :x↦n}} = truex' : evar n' : db_index E1 : no_negative_occurrence_db_b 0 φ = true E2 : well_formed_positive φ = true
no_negative_occurrence_db_b 0 φ^{{evar :x'↦n'}} = true
- Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index),
well_formed_positive φ → well_formed_positive φ^{{evar :x↦n}} = truex' : evar n' : db_index E1 : no_negative_occurrence_db_b 0 φ = true E2 : well_formed_positive φ = true
no_negative_occurrence_db_b 0 φ^{{evar :x'↦n'}} = true
now apply no_occ_quantify.
- Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index),
well_formed_positive φ → well_formed_positive φ^{{evar :x↦n}} = truex' : evar n' : db_index E1 : no_negative_occurrence_db_b 0 φ = true E2 : well_formed_positive φ = true
well_formed_positive φ^{{evar :x'↦n'}} = true
now apply IHφ.
Qed .
Corollary evar_quantify_well_formed :
forall φ x , well_formed φ ->
well_formed (patt_exists (φ^{{evar : x ↦ 0 }})) = true.Σ : Signature
∀ (φ : Pattern) (x : evar ),
well_formed φ
→ well_formed (patt_exists φ^{{evar :x↦0 }}) = true
Proof .Σ : Signature
∀ (φ : Pattern) (x : evar ),
well_formed φ
→ well_formed (patt_exists φ^{{evar :x↦0 }}) = true
intros φ x H.Σ : Signature φ : Pattern x : evar H : well_formed φ
well_formed (patt_exists φ^{{evar :x↦0 }}) = true
unfold well_formed, well_formed_closed in *.Σ : Signature φ : Pattern x : evar H : [&& well_formed_positive φ,
well_formed_closed_mu_aux φ 0
& well_formed_closed_ex_aux φ 0 ]
[&& well_formed_positive (patt_exists φ^{{evar :x↦0 }}),
well_formed_closed_mu_aux
(patt_exists φ^{{evar :x↦0 }}) 0
& well_formed_closed_ex_aux
(patt_exists φ^{{evar :x↦0 }}) 0 ] = true
destruct_and!. Σ : Signature φ : Pattern x : evar H0 : well_formed_positive φ = true H : well_formed_closed_mu_aux φ 0 = true H2 : well_formed_closed_ex_aux φ 0 = true
[&& well_formed_positive (patt_exists φ^{{evar :x↦0 }}),
well_formed_closed_mu_aux
(patt_exists φ^{{evar :x↦0 }}) 0
& well_formed_closed_ex_aux
(patt_exists φ^{{evar :x↦0 }}) 0 ] = true
split_and!; simpl . Σ : Signature φ : Pattern x : evar H0 : well_formed_positive φ = true H : well_formed_closed_mu_aux φ 0 = true H2 : well_formed_closed_ex_aux φ 0 = true
well_formed_positive φ^{{evar :x↦0 }} = true
- Σ : Signature φ : Pattern x : evar H0 : well_formed_positive φ = true H : well_formed_closed_mu_aux φ 0 = true H2 : well_formed_closed_ex_aux φ 0 = true
well_formed_positive φ^{{evar :x↦0 }} = true
apply evar_quantify_positive.Σ : Signature φ : Pattern x : evar H0 : well_formed_positive φ = true H : well_formed_closed_mu_aux φ 0 = true H2 : well_formed_closed_ex_aux φ 0 = true
well_formed_positive φ
assumption .
- Σ : Signature φ : Pattern x : evar H0 : well_formed_positive φ = true H : well_formed_closed_mu_aux φ 0 = true H2 : well_formed_closed_ex_aux φ 0 = true
well_formed_closed_mu_aux φ^{{evar :x↦0 }} 0 = true
apply evar_quantify_closed_mu.Σ : Signature φ : Pattern x : evar H0 : well_formed_positive φ = true H : well_formed_closed_mu_aux φ 0 = true H2 : well_formed_closed_ex_aux φ 0 = true
well_formed_closed_mu_aux φ 0
assumption .
- Σ : Signature φ : Pattern x : evar H0 : well_formed_positive φ = true H : well_formed_closed_mu_aux φ 0 = true H2 : well_formed_closed_ex_aux φ 0 = true
well_formed_closed_ex_aux φ^{{evar :x↦0 }} 1 = true
apply evar_quantify_closed_ex.Σ : Signature φ : Pattern x : evar H0 : well_formed_positive φ = true H : well_formed_closed_mu_aux φ 0 = true H2 : well_formed_closed_ex_aux φ 0 = true
well_formed_closed_ex_aux φ 0
assumption .
Qed .
Theorem evar_quantify_no_occurrence :
forall φ x n , x ∉ (free_evars (φ^{{evar : x ↦ n}})).Σ : Signature
∀ (φ : Pattern) (x : evar ) (n : db_index),
x ∉ free_evars φ^{{evar :x↦n}}
Proof .Σ : Signature
∀ (φ : Pattern) (x : evar ) (n : db_index),
x ∉ free_evars φ^{{evar :x↦n}}
induction φ; intros x' n'; simpl .Σ : Signature x, x' : evar n' : db_index
x'
∉ free_evars
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x)
2 -5 , 7 : apply not_elem_of_empty.Σ : Signature x, x' : evar n' : db_index
x'
∉ free_evars
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x)
* Σ : Signature x, x' : evar n' : db_index
x'
∉ free_evars
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x)
destruct (decide (x' = x)); simpl .Σ : Signature x, x' : evar n' : db_index e : x' = x
x' ∉ ∅
- Σ : Signature x, x' : evar n' : db_index e : x' = x
x' ∉ ∅
apply not_elem_of_empty.
- Σ : Signature x, x' : evar n' : db_index n : x' ≠ x
x' ∉ {[x]}
subst .Σ : Signature x, x' : evar n' : db_index n : x' ≠ x
x' ∉ {[x]}
now apply not_elem_of_singleton_2.
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1^{{evar :x↦n}}IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2^{{evar :x↦n}}x' : evar n' : db_index
x'
∉ free_evars φ1^{{evar :x'↦n'}}
∪ free_evars φ2^{{evar :x'↦n'}}
apply not_elem_of_union.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1^{{evar :x↦n}}IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2^{{evar :x↦n}}x' : evar n' : db_index
(x' ∉ free_evars φ1^{{evar :x'↦n'}})
∧ x' ∉ free_evars φ2^{{evar :x'↦n'}}
split .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1^{{evar :x↦n}}IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2^{{evar :x↦n}}x' : evar n' : db_index
x' ∉ free_evars φ1^{{evar :x'↦n'}}
apply IHφ1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1^{{evar :x↦n}}IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2^{{evar :x↦n}}x' : evar n' : db_index
x' ∉ free_evars φ2^{{evar :x'↦n'}}
apply IHφ2.
* Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1^{{evar :x↦n}}IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2^{{evar :x↦n}}x' : evar n' : db_index
x'
∉ free_evars φ1^{{evar :x'↦n'}}
∪ free_evars φ2^{{evar :x'↦n'}}
apply not_elem_of_union.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1^{{evar :x↦n}}IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2^{{evar :x↦n}}x' : evar n' : db_index
(x' ∉ free_evars φ1^{{evar :x'↦n'}})
∧ x' ∉ free_evars φ2^{{evar :x'↦n'}}
split .Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1^{{evar :x↦n}}IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2^{{evar :x↦n}}x' : evar n' : db_index
x' ∉ free_evars φ1^{{evar :x'↦n'}}
apply IHφ1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1^{{evar :x↦n}}IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2^{{evar :x↦n}}x' : evar n' : db_index
x' ∉ free_evars φ2^{{evar :x'↦n'}}
apply IHφ2.
* Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index), x ∉ free_evars φ^{{evar :x↦n}}x' : evar n' : db_index
x' ∉ free_evars φ^{{evar :x'↦S n'}}
apply IHφ.
* Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index), x ∉ free_evars φ^{{evar :x↦n}}x' : evar n' : db_index
x' ∉ free_evars φ^{{evar :x'↦n'}}
apply IHφ.
Qed .
Theorem svar_quantify_not_free :
forall φ X n , X ∉ (free_svars (φ^{{svar: X ↦ n}})).Σ : Signature
∀ (φ : Pattern) (X : svar) (n : db_index),
X ∉ free_svars φ^{{svar:X↦n}}
Proof .Σ : Signature
∀ (φ : Pattern) (X : svar) (n : db_index),
X ∉ free_svars φ^{{svar:X↦n}}
induction φ; intros x' n'; simpl ; try set_solver.Σ : Signature x, x' : svar n' : db_index
x'
∉ free_svars
(if decide (x' = x)
then patt_bound_svar n'
else patt_free_svar x)
case_match; simpl ; set_solver.
Qed .
Lemma evar_quantify_not_free_evars :
forall φ x n ,
x ∉ free_evars φ ->
φ^{{evar : x ↦ n}} = φ.Σ : Signature
∀ (φ : Pattern) (x : evar ) (n : db_index),
x ∉ free_evars φ → φ^{{evar :x↦n}} = φ
Proof .Σ : Signature
∀ (φ : Pattern) (x : evar ) (n : db_index),
x ∉ free_evars φ → φ^{{evar :x↦n}} = φ
induction φ; intros x' n' H; simpl ; auto .Σ : Signature x, x' : evar n' : db_index H : x' ∉ free_evars (patt_free_evar x)
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x) = patt_free_evar x
- Σ : Signature x, x' : evar n' : db_index H : x' ∉ free_evars (patt_free_evar x)
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x) = patt_free_evar x
destruct (decide (x = x')).Σ : Signature x, x' : evar n' : db_index H : x' ∉ free_evars (patt_free_evar x) e : x = x'
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x) = patt_free_evar x
+ Σ : Signature x, x' : evar n' : db_index H : x' ∉ free_evars (patt_free_evar x) e : x = x'
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x) = patt_free_evar x
set_solver.
+ Σ : Signature x, x' : evar n' : db_index H : x' ∉ free_evars (patt_free_evar x) n : x ≠ x'
(if decide (x' = x)
then patt_bound_evar n'
else patt_free_evar x) = patt_free_evar x
destruct (decide (x' = x)); cbn ; auto .Σ : Signature x, x' : evar n' : db_index H : x' ∉ free_evars (patt_free_evar x) n : x ≠ x' e : x' = x
patt_bound_evar n' = patt_free_evar x
set_solver.
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1 → φ1^{{evar :x↦n}} = φ1IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2 → φ2^{{evar :x↦n}} = φ2x' : evar n' : db_index H : x' ∉ free_evars (patt_app φ1 φ2)
patt_app φ1^{{evar :x'↦n'}} φ2^{{evar :x'↦n'}} =
patt_app φ1 φ2
rewrite IHφ1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1 → φ1^{{evar :x↦n}} = φ1IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2 → φ2^{{evar :x↦n}} = φ2x' : evar n' : db_index H : x' ∉ free_evars (patt_app φ1 φ2)
x' ∉ free_evars φ1
set_solver. Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1 → φ1^{{evar :x↦n}} = φ1IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2 → φ2^{{evar :x↦n}} = φ2x' : evar n' : db_index H : x' ∉ free_evars (patt_app φ1 φ2)
patt_app φ1 φ2^{{evar :x'↦n'}} = patt_app φ1 φ2
rewrite IHφ2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1 → φ1^{{evar :x↦n}} = φ1IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2 → φ2^{{evar :x↦n}} = φ2x' : evar n' : db_index H : x' ∉ free_evars (patt_app φ1 φ2)
x' ∉ free_evars φ2
set_solver. Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1 → φ1^{{evar :x↦n}} = φ1IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2 → φ2^{{evar :x↦n}} = φ2x' : evar n' : db_index H : x' ∉ free_evars (patt_app φ1 φ2)
patt_app φ1 φ2 = patt_app φ1 φ2
reflexivity .
- Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1 → φ1^{{evar :x↦n}} = φ1IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2 → φ2^{{evar :x↦n}} = φ2x' : evar n' : db_index H : x' ∉ free_evars (patt_imp φ1 φ2)
patt_imp φ1^{{evar :x'↦n'}} φ2^{{evar :x'↦n'}} =
patt_imp φ1 φ2
rewrite IHφ1.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1 → φ1^{{evar :x↦n}} = φ1IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2 → φ2^{{evar :x↦n}} = φ2x' : evar n' : db_index H : x' ∉ free_evars (patt_imp φ1 φ2)
x' ∉ free_evars φ1
set_solver. Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1 → φ1^{{evar :x↦n}} = φ1IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2 → φ2^{{evar :x↦n}} = φ2x' : evar n' : db_index H : x' ∉ free_evars (patt_imp φ1 φ2)
patt_imp φ1 φ2^{{evar :x'↦n'}} = patt_imp φ1 φ2
rewrite IHφ2.Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1 → φ1^{{evar :x↦n}} = φ1IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2 → φ2^{{evar :x↦n}} = φ2x' : evar n' : db_index H : x' ∉ free_evars (patt_imp φ1 φ2)
x' ∉ free_evars φ2
set_solver. Σ : Signature φ1, φ2 : Pattern IHφ1 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ1 → φ1^{{evar :x↦n}} = φ1IHφ2 : ∀ (x : evar ) (n : db_index),
x ∉ free_evars φ2 → φ2^{{evar :x↦n}} = φ2x' : evar n' : db_index H : x' ∉ free_evars (patt_imp φ1 φ2)
patt_imp φ1 φ2 = patt_imp φ1 φ2
reflexivity .
- Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index), x ∉ free_evars φ → φ^{{evar :x↦n}} = φx' : evar n' : db_index H : x' ∉ free_evars (patt_exists φ)
patt_exists φ^{{evar :x'↦S n'}} = patt_exists φ
rewrite IHφ.Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index), x ∉ free_evars φ → φ^{{evar :x↦n}} = φx' : evar n' : db_index H : x' ∉ free_evars (patt_exists φ)
x' ∉ free_evars φ
set_solver. Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index), x ∉ free_evars φ → φ^{{evar :x↦n}} = φx' : evar n' : db_index H : x' ∉ free_evars (patt_exists φ)
patt_exists φ = patt_exists φ
reflexivity .
- Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index), x ∉ free_evars φ → φ^{{evar :x↦n}} = φx' : evar n' : db_index H : x' ∉ free_evars (patt_mu φ)
patt_mu φ^{{evar :x'↦n'}} = patt_mu φ
rewrite IHφ.Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index), x ∉ free_evars φ → φ^{{evar :x↦n}} = φx' : evar n' : db_index H : x' ∉ free_evars (patt_mu φ)
x' ∉ free_evars φ
set_solver. Σ : Signature φ : Pattern IHφ : ∀ (x : evar ) (n : db_index), x ∉ free_evars φ → φ^{{evar :x↦n}} = φx' : evar n' : db_index H : x' ∉ free_evars (patt_mu φ)
patt_mu φ = patt_mu φ
reflexivity .
Qed .
Lemma wf_ex_evar_quantify x p :
well_formed p = true ->
well_formed (patt_exists (p^{{evar : x ↦ 0 }})) = true.Σ : Signature x : evar p : Pattern
well_formed p = true
→ well_formed (patt_exists p^{{evar :x↦0 }}) = true
Proof .Σ : Signature x : evar p : Pattern
well_formed p = true
→ well_formed (patt_exists p^{{evar :x↦0 }}) = true
intros Hwf.Σ : Signature x : evar p : Pattern Hwf : well_formed p = true
well_formed (patt_exists p^{{evar :x↦0 }}) = true
unfold well_formed,well_formed_closed in Hwf.Σ : Signature x : evar p : Pattern Hwf : [&& well_formed_positive p, well_formed_closed_mu_aux p 0
& well_formed_closed_ex_aux p 0 ] = true
well_formed (patt_exists p^{{evar :x↦0 }}) = true
simpl in Hwf.Σ : Signature x : evar p : Pattern Hwf : [&& well_formed_positive p, well_formed_closed_mu_aux p 0
& well_formed_closed_ex_aux p 0 ] = true
well_formed (patt_exists p^{{evar :x↦0 }}) = true
apply andb_prop in Hwf.Σ : Signature x : evar p : Pattern Hwf : well_formed_positive p = true
∧ well_formed_closed_mu_aux p 0 && well_formed_closed_ex_aux p 0 = true
well_formed (patt_exists p^{{evar :x↦0 }}) = true
destruct Hwf as [Hwfp Hwfc].Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true Hwfc : well_formed_closed_mu_aux p 0 &&
well_formed_closed_ex_aux p 0 = true
well_formed (patt_exists p^{{evar :x↦0 }}) = true
simpl in Hwfp.Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true Hwfc : well_formed_closed_mu_aux p 0 &&
well_formed_closed_ex_aux p 0 = true
well_formed (patt_exists p^{{evar :x↦0 }}) = true
unfold well_formed,well_formed_closed.Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true Hwfc : well_formed_closed_mu_aux p 0 &&
well_formed_closed_ex_aux p 0 = true
[&& well_formed_positive (patt_exists p^{{evar :x↦0 }}),
well_formed_closed_mu_aux
(patt_exists p^{{evar :x↦0 }}) 0
& well_formed_closed_ex_aux
(patt_exists p^{{evar :x↦0 }}) 0 ] = true
simpl .Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true Hwfc : well_formed_closed_mu_aux p 0 &&
well_formed_closed_ex_aux p 0 = true
[&& well_formed_positive p^{{evar :x↦0 }},
well_formed_closed_mu_aux p^{{evar :x↦0 }} 0
& well_formed_closed_ex_aux p^{{evar :x↦0 }} 1 ] = true
apply andb_true_intro.Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true Hwfc : well_formed_closed_mu_aux p 0 &&
well_formed_closed_ex_aux p 0 = true
well_formed_positive p^{{evar :x↦0 }} = true
∧ well_formed_closed_mu_aux p^{{evar :x↦0 }} 0 &&
well_formed_closed_ex_aux p^{{evar :x↦0 }} 1 = true
split .Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true Hwfc : well_formed_closed_mu_aux p 0 &&
well_formed_closed_ex_aux p 0 = true
well_formed_positive p^{{evar :x↦0 }} = true
- Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true Hwfc : well_formed_closed_mu_aux p 0 &&
well_formed_closed_ex_aux p 0 = true
well_formed_positive p^{{evar :x↦0 }} = true
simpl .Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true Hwfc : well_formed_closed_mu_aux p 0 &&
well_formed_closed_ex_aux p 0 = true
well_formed_positive p^{{evar :x↦0 }} = true
apply evar_quantify_positive.Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true Hwfc : well_formed_closed_mu_aux p 0 &&
well_formed_closed_ex_aux p 0 = true
well_formed_positive p
apply Hwfp.
- Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true Hwfc : well_formed_closed_mu_aux p 0 &&
well_formed_closed_ex_aux p 0 = true
well_formed_closed_mu_aux p^{{evar :x↦0 }} 0 &&
well_formed_closed_ex_aux p^{{evar :x↦0 }} 1 = true
unfold well_formed_closed.Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true Hwfc : well_formed_closed_mu_aux p 0 &&
well_formed_closed_ex_aux p 0 = true
well_formed_closed_mu_aux p^{{evar :x↦0 }} 0 &&
well_formed_closed_ex_aux p^{{evar :x↦0 }} 1 = true
simpl .Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true Hwfc : well_formed_closed_mu_aux p 0 &&
well_formed_closed_ex_aux p 0 = true
well_formed_closed_mu_aux p^{{evar :x↦0 }} 0 &&
well_formed_closed_ex_aux p^{{evar :x↦0 }} 1 = true
destruct_and!. Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true H : well_formed_closed_mu_aux p 0 = true H0 : well_formed_closed_ex_aux p 0 = true
well_formed_closed_mu_aux p^{{evar :x↦0 }} 0 &&
well_formed_closed_ex_aux p^{{evar :x↦0 }} 1 = true
split_and!. Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true H : well_formed_closed_mu_aux p 0 = true H0 : well_formed_closed_ex_aux p 0 = true
well_formed_closed_mu_aux p^{{evar :x↦0 }} 0 = true
+ Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true H : well_formed_closed_mu_aux p 0 = true H0 : well_formed_closed_ex_aux p 0 = true
well_formed_closed_mu_aux p^{{evar :x↦0 }} 0 = true
apply evar_quantify_closed_mu.Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true H : well_formed_closed_mu_aux p 0 = true H0 : well_formed_closed_ex_aux p 0 = true
well_formed_closed_mu_aux p 0
assumption .
+ Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true H : well_formed_closed_mu_aux p 0 = true H0 : well_formed_closed_ex_aux p 0 = true
well_formed_closed_ex_aux p^{{evar :x↦0 }} 1 = true
apply evar_quantify_closed_ex.Σ : Signature x : evar p : Pattern Hwfp : well_formed_positive p = true H : well_formed_closed_mu_aux p 0 = true H0 : well_formed_closed_ex_aux p 0 = true
well_formed_closed_ex_aux p 0
assumption .
Qed .
Lemma free_evars_evar_quantify x n p :
free_evars (p^{{evar : x ↦ n}}) = free_evars p ∖ {[x]}.Σ : Signature x : evar n : db_index p : Pattern
free_evars p^{{evar :x↦n}} = free_evars p ∖ {[x]}
Proof .Σ : Signature x : evar n : db_index p : Pattern
free_evars p^{{evar :x↦n}} = free_evars p ∖ {[x]}
move : n.Σ : Signature x : evar p : Pattern
∀ n : db_index,
free_evars p^{{evar :x↦n}} = free_evars p ∖ {[x]}
induction p; intros n'; simpl ; try set_solver.Σ : Signature x, x0 : evar n' : db_index
free_evars
(if decide (x = x0)
then patt_bound_evar n'
else patt_free_evar x0) = {[x0]} ∖ {[x]}
destruct (decide (x = x0)).Σ : Signature x, x0 : evar n' : db_index e : x = x0
free_evars (patt_bound_evar n') = {[x0]} ∖ {[x]}
+ Σ : Signature x, x0 : evar n' : db_index e : x = x0
free_evars (patt_bound_evar n') = {[x0]} ∖ {[x]}
subst .Σ : Signature x0 : evar n' : db_index
free_evars (patt_bound_evar n') = {[x0]} ∖ {[x0]}
simpl .Σ : Signature x0 : evar n' : db_index
∅ = {[x0]} ∖ {[x0]}
set_solver.
+ Σ : Signature x, x0 : evar n' : db_index n : x ≠ x0
free_evars (patt_free_evar x0) = {[x0]} ∖ {[x]}
simpl .Σ : Signature x, x0 : evar n' : db_index n : x ≠ x0
{[x0]} = {[x0]} ∖ {[x]}
set_solver.
Qed .
Lemma free_svars_svar_quantify X n p :
free_svars (p^{{svar: X ↦ n}}) = free_svars p ∖ {[X]}.Σ : Signature X : svar n : db_index p : Pattern
free_svars p^{{svar:X↦n}} = free_svars p ∖ {[X]}
Proof .Σ : Signature X : svar n : db_index p : Pattern
free_svars p^{{svar:X↦n}} = free_svars p ∖ {[X]}
move : n.Σ : Signature X : svar p : Pattern
∀ n : db_index,
free_svars p^{{svar:X↦n}} = free_svars p ∖ {[X]}
induction p; intros n'; simpl ; try set_solver.Σ : Signature X, x : svar n' : db_index
free_svars
(if decide (X = x)
then patt_bound_svar n'
else patt_free_svar x) = {[x]} ∖ {[X]}
destruct (decide (X = x)).Σ : Signature X, x : svar n' : db_index e : X = x
free_svars (patt_bound_svar n') = {[x]} ∖ {[X]}
+ Σ : Signature X, x : svar n' : db_index e : X = x
free_svars (patt_bound_svar n') = {[x]} ∖ {[X]}
subst .Σ : Signature x : svar n' : db_index
free_svars (patt_bound_svar n') = {[x]} ∖ {[x]}
simpl .Σ : Signature x : svar n' : db_index
∅ = {[x]} ∖ {[x]}
set_solver.
+ Σ : Signature X, x : svar n' : db_index n : X ≠ x
free_svars (patt_free_svar x) = {[x]} ∖ {[X]}
simpl .Σ : Signature X, x : svar n' : db_index n : X ≠ x
{[x]} = {[x]} ∖ {[X]}
set_solver.
Qed .
Lemma no_neg_occ_db_bsvar_subst phi psi dbi1 dbi2 :
well_formed_closed_mu_aux psi 0 = true -> dbi1 < dbi2 ->
(no_negative_occurrence_db_b dbi1 phi = true ->
no_negative_occurrence_db_b dbi1 (phi^[svar: dbi2 ↦ psi]) = true)
/\ (no_positive_occurrence_db_b dbi1 phi = true ->
no_positive_occurrence_db_b dbi1 (phi^[svar: dbi2 ↦ psi]) = true).Σ : Signature phi, psi : Pattern dbi1, dbi2 : nat
well_formed_closed_mu_aux psi 0 = true
→ dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi = true
→ no_negative_occurrence_db_b dbi1
phi^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi = true
→ no_positive_occurrence_db_b dbi1
phi^[svar:dbi2↦psi] = true)
Proof .Σ : Signature phi, psi : Pattern dbi1, dbi2 : nat
well_formed_closed_mu_aux psi 0 = true
→ dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi = true
→ no_negative_occurrence_db_b dbi1
phi^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi = true
→ no_positive_occurrence_db_b dbi1
phi^[svar:dbi2↦psi] = true)
intros Hwfcpsi.Σ : Signature phi, psi : Pattern dbi1, dbi2 : nat Hwfcpsi : well_formed_closed_mu_aux psi 0 = true
dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi = true
→ no_negative_occurrence_db_b dbi1
phi^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi = true
→ no_positive_occurrence_db_b dbi1
phi^[svar:dbi2↦psi] = true)
move : dbi1 dbi2.Σ : Signature phi, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true
∀ dbi1 dbi2 : nat,
dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi = true
→ no_negative_occurrence_db_b dbi1
phi^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi = true
→ no_positive_occurrence_db_b dbi1
phi^[svar:dbi2↦psi] = true)
induction phi; intros dbi1 dbi2 H; simpl ; auto .Σ : Signature n : db_index psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat H : dbi1 < dbi2
(no_negative_occurrence_db_b dbi1 (patt_bound_svar n) =
true
→ no_negative_occurrence_db_b dbi1
match compare_nat n dbi2 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_svar (Nat.pred n)
end = true)
∧ (no_positive_occurrence_db_b dbi1
(patt_bound_svar n) = true
→ no_positive_occurrence_db_b dbi1
match compare_nat n dbi2 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_svar (Nat.pred n)
end = true)
- Σ : Signature n : db_index psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat H : dbi1 < dbi2
(no_negative_occurrence_db_b dbi1 (patt_bound_svar n) =
true
→ no_negative_occurrence_db_b dbi1
match compare_nat n dbi2 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_svar (Nat.pred n)
end = true)
∧ (no_positive_occurrence_db_b dbi1
(patt_bound_svar n) = true
→ no_positive_occurrence_db_b dbi1
match compare_nat n dbi2 with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_svar (Nat.pred n)
end = true)
case_match; auto . Σ : Signature n : db_index psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat H : dbi1 < dbi2 e : n = dbi2 H0 : compare_nat n dbi2 = Nat_equal n dbi2 e
(no_negative_occurrence_db_b dbi1 (patt_bound_svar n) =
true → no_negative_occurrence_db_b dbi1 psi = true)
∧ (no_positive_occurrence_db_b dbi1
(patt_bound_svar n) = true
→ no_positive_occurrence_db_b dbi1 psi = true)
+ Σ : Signature n : db_index psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat H : dbi1 < dbi2 e : n = dbi2 H0 : compare_nat n dbi2 = Nat_equal n dbi2 e
(no_negative_occurrence_db_b dbi1 (patt_bound_svar n) =
true → no_negative_occurrence_db_b dbi1 psi = true)
∧ (no_positive_occurrence_db_b dbi1
(patt_bound_svar n) = true
→ no_positive_occurrence_db_b dbi1 psi = true)
split ; intros H0'.Σ : Signature n : db_index psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat H : dbi1 < dbi2 e : n = dbi2 H0 : compare_nat n dbi2 = Nat_equal n dbi2 e H0' : no_negative_occurrence_db_b dbi1
(patt_bound_svar n) = true
no_negative_occurrence_db_b dbi1 psi = true
* Σ : Signature n : db_index psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat H : dbi1 < dbi2 e : n = dbi2 H0 : compare_nat n dbi2 = Nat_equal n dbi2 e H0' : no_negative_occurrence_db_b dbi1
(patt_bound_svar n) = true
no_negative_occurrence_db_b dbi1 psi = true
apply wfc_impl_no_neg_occ.Σ : Signature n : db_index psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat H : dbi1 < dbi2 e : n = dbi2 H0 : compare_nat n dbi2 = Nat_equal n dbi2 e H0' : no_negative_occurrence_db_b dbi1
(patt_bound_svar n) = true
well_formed_closed_mu_aux psi 0 = true
apply Hwfcpsi.
* Σ : Signature n : db_index psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat H : dbi1 < dbi2 e : n = dbi2 H0 : compare_nat n dbi2 = Nat_equal n dbi2 e H0' : no_positive_occurrence_db_b dbi1
(patt_bound_svar n) = true
no_positive_occurrence_db_b dbi1 psi = true
apply wfc_impl_no_pos_occ.Σ : Signature n : db_index psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat H : dbi1 < dbi2 e : n = dbi2 H0 : compare_nat n dbi2 = Nat_equal n dbi2 e H0' : no_positive_occurrence_db_b dbi1
(patt_bound_svar n) = true
well_formed_closed_mu_aux psi 0 = true
apply Hwfcpsi.
+ Σ : Signature n : db_index psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat H : dbi1 < dbi2 g : n > dbi2 H0 : compare_nat n dbi2 = Nat_greater n dbi2 g
(no_negative_occurrence_db_b dbi1 (patt_bound_svar n) =
true
→ no_negative_occurrence_db_b dbi1
(patt_bound_svar (Nat.pred n)) = true)
∧ (no_positive_occurrence_db_b dbi1
(patt_bound_svar n) = true
→ no_positive_occurrence_db_b dbi1
(patt_bound_svar (Nat.pred n)) = true)
split ; intros H0'.Σ : Signature n : db_index psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat H : dbi1 < dbi2 g : n > dbi2 H0 : compare_nat n dbi2 = Nat_greater n dbi2 g H0' : no_negative_occurrence_db_b dbi1
(patt_bound_svar n) = true
no_negative_occurrence_db_b dbi1
(patt_bound_svar (Nat.pred n)) = true
* Σ : Signature n : db_index psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat H : dbi1 < dbi2 g : n > dbi2 H0 : compare_nat n dbi2 = Nat_greater n dbi2 g H0' : no_negative_occurrence_db_b dbi1
(patt_bound_svar n) = true
no_negative_occurrence_db_b dbi1
(patt_bound_svar (Nat.pred n)) = true
auto .
* Σ : Signature n : db_index psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat H : dbi1 < dbi2 g : n > dbi2 H0 : compare_nat n dbi2 = Nat_greater n dbi2 g H0' : no_positive_occurrence_db_b dbi1
(patt_bound_svar n) = true
no_positive_occurrence_db_b dbi1
(patt_bound_svar (Nat.pred n)) = true
cbn .Σ : Signature n : db_index psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat H : dbi1 < dbi2 g : n > dbi2 H0 : compare_nat n dbi2 = Nat_greater n dbi2 g H0' : no_positive_occurrence_db_b dbi1
(patt_bound_svar n) = true
(if decide (Nat.pred n = dbi1) then false else true) =
true
repeat case_match.Σ : Signature n : db_index psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat H : dbi1 < dbi2 g : n > dbi2 H0 : compare_nat n dbi2 = Nat_greater n dbi2 g H0' : no_positive_occurrence_db_b dbi1
(patt_bound_svar n) = true e : Nat.pred n = dbi1 H1 : decide (Nat.pred n = dbi1) = left e
false = true
lia .Σ : Signature n : db_index psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat H : dbi1 < dbi2 g : n > dbi2 H0 : compare_nat n dbi2 = Nat_greater n dbi2 g H0' : no_positive_occurrence_db_b dbi1
(patt_bound_svar n) = true n0 : Nat.pred n ≠ dbi1 H1 : decide (Nat.pred n = dbi1) = right n0
true = true
reflexivity .
- Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true IHphi1 : ∀ dbi1 dbi2 : nat,
dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)IHphi2 : ∀ dbi1 dbi2 : nat,
dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)dbi1, dbi2 : nat H : dbi1 < dbi2
(no_negative_occurrence_db_b dbi1 (patt_app phi1 phi2) =
true
→ no_negative_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
∧ (no_positive_occurrence_db_b dbi1
(patt_app phi1 phi2) = true
→ no_positive_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
specialize (IHphi1 dbi1 dbi2).Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : ∀ dbi1 dbi2 : nat,
dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)H : dbi1 < dbi2
(no_negative_occurrence_db_b dbi1 (patt_app phi1 phi2) =
true
→ no_negative_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
∧ (no_positive_occurrence_db_b dbi1
(patt_app phi1 phi2) = true
→ no_positive_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
specialize (IHphi2 dbi1 dbi2).Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2
(no_negative_occurrence_db_b dbi1 (patt_app phi1 phi2) =
true
→ no_negative_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
∧ (no_positive_occurrence_db_b dbi1
(patt_app phi1 phi2) = true
→ no_positive_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
destruct (IHphi1 H) as [IHphi11 IHphi12].Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true
(no_negative_occurrence_db_b dbi1 (patt_app phi1 phi2) =
true
→ no_negative_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
∧ (no_positive_occurrence_db_b dbi1
(patt_app phi1 phi2) = true
→ no_positive_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
destruct (IHphi2 H) as [IHphi21 IHphi22].Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true
(no_negative_occurrence_db_b dbi1 (patt_app phi1 phi2) =
true
→ no_negative_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
∧ (no_positive_occurrence_db_b dbi1
(patt_app phi1 phi2) = true
→ no_positive_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
split ; intro H0.Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H0 : no_negative_occurrence_db_b dbi1
(patt_app phi1 phi2) = true
no_negative_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
+ Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H0 : no_negative_occurrence_db_b dbi1
(patt_app phi1 phi2) = true
no_negative_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
eapply elimT in H0.Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H0 : ?P
no_negative_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
2 : apply andP.Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H0 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1
∧ (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi2
no_negative_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
destruct H0 as [H1 H2].Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi2
no_negative_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
specialize (IHphi11 H1).Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi2
no_negative_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
specialize (IHphi21 H2).Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi2
no_negative_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
cbn .Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi2
no_negative_occurrence_db_b dbi1 phi1^[svar:dbi2↦psi] &&
no_negative_occurrence_db_b dbi1 phi2^[svar:dbi2↦psi] =
true
rewrite IHphi11 IHphi21.Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi2
true && true = true
reflexivity .
+ Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H0 : no_positive_occurrence_db_b dbi1
(patt_app phi1 phi2) = true
no_positive_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
eapply elimT in H0.Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H0 : ?P
no_positive_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
2 : apply andP.Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H0 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1
∧ (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi2
no_positive_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
destruct H0 as [H1 H2].Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi2
no_positive_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
specialize (IHphi12 H1).Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi2
no_positive_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
specialize (IHphi22 H2).Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi2
no_positive_occurrence_db_b dbi1
(patt_app phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
cbn .Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi2
no_positive_occurrence_db_b dbi1 phi1^[svar:dbi2↦psi] &&
no_positive_occurrence_db_b dbi1 phi2^[svar:dbi2↦psi] =
true
rewrite IHphi12 IHphi22.Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi2
true && true = true
reflexivity .
- Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true IHphi1 : ∀ dbi1 dbi2 : nat,
dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)IHphi2 : ∀ dbi1 dbi2 : nat,
dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)dbi1, dbi2 : nat H : dbi1 < dbi2
(no_negative_occurrence_db_b dbi1 (patt_imp phi1 phi2) =
true
→ no_negative_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
∧ (no_positive_occurrence_db_b dbi1
(patt_imp phi1 phi2) = true
→ no_positive_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
specialize (IHphi1 dbi1 dbi2).Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : ∀ dbi1 dbi2 : nat,
dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)H : dbi1 < dbi2
(no_negative_occurrence_db_b dbi1 (patt_imp phi1 phi2) =
true
→ no_negative_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
∧ (no_positive_occurrence_db_b dbi1
(patt_imp phi1 phi2) = true
→ no_positive_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
specialize (IHphi2 dbi1 dbi2).Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2
(no_negative_occurrence_db_b dbi1 (patt_imp phi1 phi2) =
true
→ no_negative_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
∧ (no_positive_occurrence_db_b dbi1
(patt_imp phi1 phi2) = true
→ no_positive_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
destruct (IHphi1 H) as [IHphi11 IHphi12].Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true
(no_negative_occurrence_db_b dbi1 (patt_imp phi1 phi2) =
true
→ no_negative_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
∧ (no_positive_occurrence_db_b dbi1
(patt_imp phi1 phi2) = true
→ no_positive_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
destruct (IHphi2 H) as [IHphi21 IHphi22].Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true
(no_negative_occurrence_db_b dbi1 (patt_imp phi1 phi2) =
true
→ no_negative_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
∧ (no_positive_occurrence_db_b dbi1
(patt_imp phi1 phi2) = true
→ no_positive_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi]
phi2^[svar:dbi2↦psi]) = true)
split ; intro H0.Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H0 : no_negative_occurrence_db_b dbi1
(patt_imp phi1 phi2) = true
no_negative_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
+ Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H0 : no_negative_occurrence_db_b dbi1
(patt_imp phi1 phi2) = true
no_negative_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
eapply elimT in H0.Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H0 : ?P
no_negative_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
2 : apply andP.Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H0 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1
∧ (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi2
no_negative_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
destruct H0 as [H1 H2].Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi2
no_negative_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
specialize (IHphi12 H1).Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi2
no_negative_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
specialize (IHphi21 H2).Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi2
no_negative_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
cbn .Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi2
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1
phi1^[svar:dbi2↦psi] &&
no_negative_occurrence_db_b dbi1 phi2^[svar:dbi2↦psi] =
true
fold no_negative_occurrence_db_b no_positive_occurrence_db_b.Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi2
no_positive_occurrence_db_b dbi1 phi1^[svar:dbi2↦psi] &&
no_negative_occurrence_db_b dbi1 phi2^[svar:dbi2↦psi] =
true
rewrite IHphi12 IHphi21.Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi2
true && true = true
reflexivity .
+ Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H0 : no_positive_occurrence_db_b dbi1
(patt_imp phi1 phi2) = true
no_positive_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
eapply elimT in H0.Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H0 : ?P
no_positive_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
2 : apply andP.Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H0 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1
∧ (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi2
no_positive_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
destruct H0 as [H1 H2].Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1 phi1 = true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi2
no_positive_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
specialize (IHphi11 H1).Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1 phi2 = true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi2
no_positive_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
specialize (IHphi22 H2).Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi2
no_positive_occurrence_db_b dbi1
(patt_imp phi1^[svar:dbi2↦psi] phi2^[svar:dbi2↦psi]) =
true
cbn .Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi2
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1
phi1^[svar:dbi2↦psi] &&
no_positive_occurrence_db_b dbi1 phi2^[svar:dbi2↦psi] =
true
fold no_negative_occurrence_db_b no_positive_occurrence_db_b.Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi2
no_negative_occurrence_db_b dbi1 phi1^[svar:dbi2↦psi] &&
no_positive_occurrence_db_b dbi1 phi2^[svar:dbi2↦psi] =
true
rewrite IHphi11 IHphi22.Σ : Signature phi1, phi2, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true dbi1, dbi2 : nat IHphi1 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi1 =
true
→ no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi1 =
true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true) IHphi2 : dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi2 =
true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi2 =
true
→ no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true) H : dbi1 < dbi2 IHphi11 : no_negative_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi12 : no_positive_occurrence_db_b dbi1 phi1 = true
→ no_positive_occurrence_db_b dbi1
phi1^[svar:dbi2↦psi] = true IHphi21 : no_negative_occurrence_db_b dbi1 phi2 = true
→ no_negative_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true IHphi22 : no_positive_occurrence_db_b dbi1
phi2^[svar:dbi2↦psi] = true H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 phi1 H2 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 phi2
true && true = true
reflexivity .
- Σ : Signature phi, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true IHphi : ∀ dbi1 dbi2 : nat,
dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi =
true
→ no_negative_occurrence_db_b dbi1
phi^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi =
true
→ no_positive_occurrence_db_b dbi1
phi^[svar:dbi2↦psi] = true)dbi1, dbi2 : nat H : dbi1 < dbi2
(no_negative_occurrence_db_b dbi1 (patt_exists phi) =
true
→ no_negative_occurrence_db_b dbi1
(patt_exists phi^[svar:dbi2↦psi]) = true)
∧ (no_positive_occurrence_db_b dbi1 (patt_exists phi) =
true
→ no_positive_occurrence_db_b dbi1
(patt_exists phi^[svar:dbi2↦psi]) = true)
split ; intros H0; apply IHphi; auto ; lia .
- Σ : Signature phi, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true IHphi : ∀ dbi1 dbi2 : nat,
dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi =
true
→ no_negative_occurrence_db_b dbi1
phi^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi =
true
→ no_positive_occurrence_db_b dbi1
phi^[svar:dbi2↦psi] = true)dbi1, dbi2 : nat H : dbi1 < dbi2
(no_negative_occurrence_db_b dbi1 (patt_mu phi) = true
→ no_negative_occurrence_db_b dbi1
(patt_mu phi^[svar:S dbi2↦psi]) = true)
∧ (no_positive_occurrence_db_b dbi1 (patt_mu phi) =
true
→ no_positive_occurrence_db_b dbi1
(patt_mu phi^[svar:S dbi2↦psi]) = true)
apply IHphi.Σ : Signature phi, psi : Pattern Hwfcpsi : well_formed_closed_mu_aux psi 0 = true IHphi : ∀ dbi1 dbi2 : nat,
dbi1 < dbi2
→ (no_negative_occurrence_db_b dbi1 phi =
true
→ no_negative_occurrence_db_b dbi1
phi^[svar:dbi2↦psi] = true)
∧ (no_positive_occurrence_db_b dbi1 phi =
true
→ no_positive_occurrence_db_b dbi1
phi^[svar:dbi2↦psi] = true)dbi1, dbi2 : nat H : dbi1 < dbi2
S dbi1 < S dbi2
lia .
Qed .
Lemma Private_wfp_bsvar_subst (phi psi : Pattern) (n : nat) :
well_formed_positive psi ->
well_formed_closed_mu_aux psi 0 ->
well_formed_positive phi ->
(
no_negative_occurrence_db_b n phi ->
well_formed_positive (phi^[svar: n ↦ psi]) )
/\ (no_positive_occurrence_db_b n phi ->
forall phi' ,
well_formed_positive phi' ->
well_formed_positive (patt_imp (phi^[svar: n ↦ psi]) phi')
)
.Σ : Signature phi, psi : Pattern n : nat
well_formed_positive psi
→ well_formed_closed_mu_aux psi 0
→ well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
(patt_imp phi^[svar:n↦psi] phi'))
Proof .Σ : Signature phi, psi : Pattern n : nat
well_formed_positive psi
→ well_formed_closed_mu_aux psi 0
→ well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
(patt_imp phi^[svar:n↦psi] phi'))
intros Hwfppsi Hwfcpsi.Σ : Signature phi, psi : Pattern n : nat Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
(patt_imp phi^[svar:n↦psi] phi'))
move : n.Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0
∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
(patt_imp phi^[svar:n↦psi] phi'))
induction phi; intros n' Hwfpphi; cbn in *; auto .Σ : Signature n : db_index psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat Hwfpphi : true
(true
→ well_formed_positive
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_svar (Nat.pred n)
end )
∧ ((if decide (n = n') then false else true)
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_svar (Nat.pred n)
end && well_formed_positive phi')
- Σ : Signature n : db_index psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat Hwfpphi : true
(true
→ well_formed_positive
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_svar (Nat.pred n)
end )
∧ ((if decide (n = n') then false else true)
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_svar (Nat.pred n)
end && well_formed_positive phi')
split .Σ : Signature n : db_index psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat Hwfpphi : true
true
→ well_formed_positive
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_svar (Nat.pred n)
end
+ Σ : Signature n : db_index psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat Hwfpphi : true
true
→ well_formed_positive
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_svar (Nat.pred n)
end
intros _.Σ : Signature n : db_index psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat Hwfpphi : true
well_formed_positive
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end
case_match; auto .
+ Σ : Signature n : db_index psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat Hwfpphi : true
(if decide (n = n') then false else true)
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_svar (Nat.pred n)
end && well_formed_positive phi'
intros H phi' Hwfphi'.Σ : Signature n : db_index psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat Hwfpphi : true H : if decide (n = n') then false else truephi' : Pattern Hwfphi' : well_formed_positive phi'
well_formed_positive
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end && well_formed_positive phi'
cbn in *.Σ : Signature n : db_index psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat Hwfpphi : true H : if decide (n = n') then false else truephi' : Pattern Hwfphi' : well_formed_positive phi'
well_formed_positive
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end && well_formed_positive phi'
do 2 case_match; auto .
- Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2
(no_negative_occurrence_db_b n' phi1 &&
no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi])
∧ (no_positive_occurrence_db_b n' phi1 &&
no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi')
split .Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2
no_negative_occurrence_db_b n' phi1 &&
no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
+ Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2
no_negative_occurrence_db_b n' phi1 &&
no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
intros Hnoneg.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2 Hnoneg : no_negative_occurrence_db_b n' phi1 &&
no_negative_occurrence_db_b n' phi2
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
apply andb_prop in Hnoneg.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2 Hnoneg : no_negative_occurrence_db_b n' phi1 = true
∧ no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
destruct Hnoneg as [Hnoneg1 Hnoneg2].Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2 Hnoneg1 : no_negative_occurrence_db_b n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
apply andb_prop in Hwfpphi.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 = true
∧ well_formed_positive phi2 = true Hnoneg1 : no_negative_occurrence_db_b n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
destruct Hwfpphi as [Hwfpphi1 Hwfpphi2].Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnoneg1 : no_negative_occurrence_db_b n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
specialize (IHphi1 n' Hwfpphi1).Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi1 : (no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi])
∧ (no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi') IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnoneg1 : no_negative_occurrence_db_b n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
destruct IHphi1 as [IHphi11 IHphi12].Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnoneg1 : no_negative_occurrence_db_b n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
specialize (IHphi11 Hnoneg1).Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnoneg1 : no_negative_occurrence_db_b n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
rewrite IHphi11.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnoneg1 : no_negative_occurrence_db_b n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
true && well_formed_positive phi2^[svar:n'↦psi]
specialize (IHphi2 n' Hwfpphi2).Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi2 : (no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi])
∧ (no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi') Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnoneg1 : no_negative_occurrence_db_b n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
true && well_formed_positive phi2^[svar:n'↦psi]
destruct IHphi2 as [IHphi21 IHphi22].Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnoneg1 : no_negative_occurrence_db_b n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
true && well_formed_positive phi2^[svar:n'↦psi]
specialize (IHphi21 Hnoneg2).Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnoneg1 : no_negative_occurrence_db_b n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
true && well_formed_positive phi2^[svar:n'↦psi]
rewrite IHphi21.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnoneg1 : no_negative_occurrence_db_b n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
true && true
auto .
+ Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2
no_positive_occurrence_db_b n' phi1 &&
no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
intros Hnopos.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2 Hnopos : no_positive_occurrence_db_b n' phi1 &&
no_positive_occurrence_db_b n' phi2
∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
apply andb_prop in Hnopos.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2 Hnopos : no_positive_occurrence_db_b n' phi1 = true
∧ no_positive_occurrence_db_b n' phi2 = true
∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
destruct Hnopos as [Hnopos1 Hnopos2].Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2 Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true
∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
apply andb_prop in Hwfpphi.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 = true
∧ well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true
∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
destruct Hwfpphi as [Hwfpphi1 Hwfpphi2].Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true
∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
intros phi' Hwfpphi'.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
specialize (IHphi1 n' Hwfpphi1).Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi1 : (no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi])
∧ (no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi') IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
specialize (IHphi2 n' Hwfpphi2).Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi1 : (no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi])
∧ (no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi') IHphi2 : (no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi])
∧ (no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi') Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
destruct IHphi1 as [IHphi11 IHphi12].Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi2 : (no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi])
∧ (no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi') Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
destruct IHphi2 as [IHphi21 IHphi22].Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
rewrite IHphi12.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
no_positive_occurrence_db_b n' phi1
fold no_negative_occurrence_db_b no_positive_occurrence_db_b in *.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
no_positive_occurrence_db_b n' phi1
{ Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
no_positive_occurrence_db_b n' phi1
rewrite Hnopos1.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
true
auto . } Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi2^[svar:n'↦psi]
specialize (IHphi22 Hnopos2 phi' Hwfpphi').Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] phi' : Pattern IHphi22 : well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true Hwfpphi' : well_formed_positive phi'
well_formed_positive phi2^[svar:n'↦psi]
apply andb_prop in IHphi22.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] phi' : Pattern IHphi22 : well_formed_positive phi2^[svar:n'↦psi] =
true ∧ well_formed_positive phi' = true Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true Hwfpphi' : well_formed_positive phi'
well_formed_positive phi2^[svar:n'↦psi]
destruct IHphi22 as [IHphi221 IHphi222].Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] phi' : Pattern IHphi221 : well_formed_positive phi2^[svar:n'↦psi] =
true IHphi222 : well_formed_positive phi' = true Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true Hwfpphi' : well_formed_positive phi'
well_formed_positive phi2^[svar:n'↦psi]
rewrite IHphi221.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] phi' : Pattern IHphi221 : well_formed_positive phi2^[svar:n'↦psi] =
true IHphi222 : well_formed_positive phi' = true Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true Hwfpphi' : well_formed_positive phi'
true
auto .Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
true && well_formed_positive phi'
rewrite Hwfpphi'.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : no_positive_occurrence_db_b n' phi1 = true Hnopos2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
true && true
auto .
- Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2
((fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 &&
no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi])
∧ ((fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n' phi1 &&
no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi')
split .Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 &&
no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
+ Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 &&
no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
intros Hnoposneg.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2 Hnoposneg : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct
ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct
ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 &&
no_negative_occurrence_db_b n' phi2
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
apply andb_prop in Hnoposneg.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2 Hnoposneg : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct
ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct
ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 =
true
∧ no_negative_occurrence_db_b n' phi2 =
true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
destruct Hnoposneg as [Hnopos1 Hnoneg2].Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2 Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
apply andb_prop in Hwfpphi.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 = true
∧ well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
destruct Hwfpphi as [Hwfpphi1 Hwfpphi2].Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
specialize (IHphi1 n' Hwfpphi1).Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi1 : (no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi])
∧ (no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi') IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
specialize (IHphi2 n' Hwfpphi2).Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi1 : (no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi])
∧ (no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi') IHphi2 : (no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi])
∧ (no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi') Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
destruct IHphi1 as [IHphi11 IHphi12].Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi2 : (no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi])
∧ (no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi') Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
destruct IHphi2 as [IHphi21 IHphi22].Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
specialize (IHphi12 Hnopos1).Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi'IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
clear IHphi11.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi12 : ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi'IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
specialize (IHphi21 Hnoneg2).Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi12 : ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi'IHphi21 : well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
clear IHphi22.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi12 : ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi'IHphi21 : well_formed_positive phi2^[svar:n'↦psi] Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi]
rewrite IHphi21.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi12 : ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi'IHphi21 : well_formed_positive phi2^[svar:n'↦psi] Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] && true
specialize (IHphi12 patt_bott).Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi12 : well_formed_positive patt_bott
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive patt_bott IHphi21 : well_formed_positive phi2^[svar:n'↦psi] Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] && true
simpl in IHphi12.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi12 : true
→ well_formed_positive phi1^[svar:n'↦psi] &&
true IHphi21 : well_formed_positive phi2^[svar:n'↦psi] Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
well_formed_positive phi1^[svar:n'↦psi] && true
assert (Htrue: is_true true).Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi12 : true
→ well_formed_positive phi1^[svar:n'↦psi] &&
true IHphi21 : well_formed_positive phi2^[svar:n'↦psi] Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
true
{ Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi12 : true
→ well_formed_positive phi1^[svar:n'↦psi] &&
true IHphi21 : well_formed_positive phi2^[svar:n'↦psi] Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true
true
auto . } Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi12 : true
→ well_formed_positive phi1^[svar:n'↦psi] &&
true IHphi21 : well_formed_positive phi2^[svar:n'↦psi] Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true Htrue : true
well_formed_positive phi1^[svar:n'↦psi] && true
specialize (IHphi12 Htrue).Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi12 : well_formed_positive phi1^[svar:n'↦psi] &&
true IHphi21 : well_formed_positive phi2^[svar:n'↦psi] Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true Htrue : true
well_formed_positive phi1^[svar:n'↦psi] && true
rewrite IHphi12.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi12 : well_formed_positive phi1^[svar:n'↦psi] &&
true IHphi21 : well_formed_positive phi2^[svar:n'↦psi] Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' phi1 = true Hnoneg2 : no_negative_occurrence_db_b n' phi2 = true Htrue : true
true
auto .
+ Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n' phi1 &&
no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
intros Hnoposneg phi' Hwfpphi'.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2 Hnoposneg : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct
ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct
ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n' phi1 &&
no_positive_occurrence_db_b n' phi2 phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
apply andb_prop in Hnoposneg.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2 Hnoposneg : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct
ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct
ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n' phi1 =
true
∧ no_positive_occurrence_db_b n' phi2 =
true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
destruct Hnoposneg as [Hnopos1 Hnoneg2].Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 &&
well_formed_positive phi2 Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n' phi1 = true Hnoneg2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
apply andb_prop in Hwfpphi.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : well_formed_positive phi1 = true
∧ well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n' phi1 = true Hnoneg2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
destruct Hwfpphi as [Hwfpphi1 Hwfpphi2].Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi1 : ∀ n : nat,
well_formed_positive phi1
→ (no_negative_occurrence_db_b n phi1
→ well_formed_positive phi1^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n↦psi] &&
well_formed_positive phi')IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n' phi1 = true Hnoneg2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
specialize (IHphi1 n' Hwfpphi1).Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi1 : (no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi])
∧ (no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi') IHphi2 : ∀ n : nat,
well_formed_positive phi2
→ (no_negative_occurrence_db_b n phi2
→ well_formed_positive phi2^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n↦psi] &&
well_formed_positive phi')Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n' phi1 = true Hnoneg2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
specialize (IHphi2 n' Hwfpphi2).Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi1 : (no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi])
∧ (no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi') IHphi2 : (no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi])
∧ (no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi') Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n' phi1 = true Hnoneg2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
destruct IHphi1 as [IHphi11 IHphi12].Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi2 : (no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi])
∧ (no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi') Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n' phi1 = true Hnoneg2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
destruct IHphi2 as [IHphi21 IHphi22].Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : no_negative_occurrence_db_b n' phi1
→ well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n' phi1 = true Hnoneg2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
specialize (IHphi11 Hnopos1).Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : well_formed_positive phi1^[svar:n'↦psi] IHphi12 : no_positive_occurrence_db_b n' phi1
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi1^[svar:n'↦psi] &&
well_formed_positive phi' IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n' phi1 = true Hnoneg2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
clear IHphi12.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : well_formed_positive phi1^[svar:n'↦psi] IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] IHphi22 : no_positive_occurrence_db_b n' phi2
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi2^[svar:n'↦psi] &&
well_formed_positive phi' Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n' phi1 = true Hnoneg2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
specialize (IHphi22 Hnoneg2).Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : well_formed_positive phi1^[svar:n'↦psi] IHphi21 : no_negative_occurrence_db_b n' phi2
→ well_formed_positive phi2^[svar:n'↦psi] IHphi22 : ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n' phi1 = true Hnoneg2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
clear IHphi21.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : well_formed_positive phi1^[svar:n'↦psi] IHphi22 : ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n' phi1 = true Hnoneg2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
well_formed_positive phi1^[svar:n'↦psi] &&
well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
rewrite IHphi11.Σ : Signature phi1, phi2, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 n' : nat IHphi11 : well_formed_positive phi1^[svar:n'↦psi] IHphi22 : ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'Hwfpphi1 : well_formed_positive phi1 = true Hwfpphi2 : well_formed_positive phi2 = true Hnopos1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n' phi1 = true Hnoneg2 : no_positive_occurrence_db_b n' phi2 = true phi' : Pattern Hwfpphi' : well_formed_positive phi'
true && well_formed_positive phi2^[svar:n'↦psi] &&
well_formed_positive phi'
rewrite IHphi22; auto .
- Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : no_negative_occurrence_db_b 0 phi &&
well_formed_positive phi
(no_negative_occurrence_db_b (S n') phi
→ no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi])
∧ (no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ no_negative_occurrence_db_b 0
phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi] &&
well_formed_positive phi')
apply andb_prop in Hwfpphi.Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi : no_negative_occurrence_db_b 0 phi = true
∧ well_formed_positive phi = true
(no_negative_occurrence_db_b (S n') phi
→ no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi])
∧ (no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ no_negative_occurrence_db_b 0
phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi] &&
well_formed_positive phi')
destruct Hwfpphi as [Hwfpphi1 Hwfpphi2].Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true
(no_negative_occurrence_db_b (S n') phi
→ no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi])
∧ (no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ no_negative_occurrence_db_b 0
phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi] &&
well_formed_positive phi')
pose proof (IHphi' := IHphi (S n') Hwfpphi2).Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true IHphi' : (no_negative_occurrence_db_b (S n') phi
→ well_formed_positive phi^[svar:S n'↦psi])
∧ (no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:S n'↦psi] &&
well_formed_positive phi')
(no_negative_occurrence_db_b (S n') phi
→ no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi])
∧ (no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ no_negative_occurrence_db_b 0
phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi] &&
well_formed_positive phi')
destruct IHphi' as [IHphi1' IHphi2'].Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true IHphi1' : no_negative_occurrence_db_b (S n') phi
→ well_formed_positive phi^[svar:S n'↦psi] IHphi2' : no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:S n'↦psi] &&
well_formed_positive phi'
(no_negative_occurrence_db_b (S n') phi
→ no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi])
∧ (no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ no_negative_occurrence_db_b 0
phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi] &&
well_formed_positive phi')
assert (H: no_negative_occurrence_db_b 0 (phi^[svar: S n' ↦ psi])).Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true IHphi1' : no_negative_occurrence_db_b (S n') phi
→ well_formed_positive phi^[svar:S n'↦psi] IHphi2' : no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:S n'↦psi] &&
well_formed_positive phi'
no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi]
{ Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true IHphi1' : no_negative_occurrence_db_b (S n') phi
→ well_formed_positive phi^[svar:S n'↦psi] IHphi2' : no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:S n'↦psi] &&
well_formed_positive phi'
no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi]
clear IHphi1' IHphi2'.Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true
no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi]
apply no_neg_occ_db_bsvar_subst; auto .Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true
0 < S n'
lia .
} Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true IHphi1' : no_negative_occurrence_db_b (S n') phi
→ well_formed_positive phi^[svar:S n'↦psi] IHphi2' : no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:S n'↦psi] &&
well_formed_positive phi' H : no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi]
(no_negative_occurrence_db_b (S n') phi
→ no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi])
∧ (no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ no_negative_occurrence_db_b 0
phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi] &&
well_formed_positive phi')
split .Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true IHphi1' : no_negative_occurrence_db_b (S n') phi
→ well_formed_positive phi^[svar:S n'↦psi] IHphi2' : no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:S n'↦psi] &&
well_formed_positive phi' H : no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi]
no_negative_occurrence_db_b (S n') phi
→ no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi]
+ Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true IHphi1' : no_negative_occurrence_db_b (S n') phi
→ well_formed_positive phi^[svar:S n'↦psi] IHphi2' : no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:S n'↦psi] &&
well_formed_positive phi' H : no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi]
no_negative_occurrence_db_b (S n') phi
→ no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi]
intros Hnonegphi.Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true IHphi1' : no_negative_occurrence_db_b (S n') phi
→ well_formed_positive phi^[svar:S n'↦psi] IHphi2' : no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:S n'↦psi] &&
well_formed_positive phi' H : no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] Hnonegphi : no_negative_occurrence_db_b (S n') phi
no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi]
specialize (IHphi1' Hnonegphi).Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true IHphi1' : well_formed_positive phi^[svar:S n'↦psi] IHphi2' : no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:S n'↦psi] &&
well_formed_positive phi' H : no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] Hnonegphi : no_negative_occurrence_db_b (S n') phi
no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi]
rewrite IHphi1'.Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true IHphi1' : well_formed_positive phi^[svar:S n'↦psi] IHphi2' : no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:S n'↦psi] &&
well_formed_positive phi' H : no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] Hnonegphi : no_negative_occurrence_db_b (S n') phi
no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] &&
true
rewrite H.Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true IHphi1' : well_formed_positive phi^[svar:S n'↦psi] IHphi2' : no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:S n'↦psi] &&
well_formed_positive phi' H : no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] Hnonegphi : no_negative_occurrence_db_b (S n') phi
true && true
auto .
+ Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true IHphi1' : no_negative_occurrence_db_b (S n') phi
→ well_formed_positive phi^[svar:S n'↦psi] IHphi2' : no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:S n'↦psi] &&
well_formed_positive phi' H : no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi]
no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ no_negative_occurrence_db_b 0
phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi] &&
well_formed_positive phi'
intros Hnopos phi' Hwfpphi'.Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true IHphi1' : no_negative_occurrence_db_b (S n') phi
→ well_formed_positive phi^[svar:S n'↦psi] IHphi2' : no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:S n'↦psi] &&
well_formed_positive phi' H : no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] Hnopos : no_positive_occurrence_db_b (S n') phi phi' : Pattern Hwfpphi' : well_formed_positive phi'
no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] &&
well_formed_positive phi^[svar:S n'↦psi] &&
well_formed_positive phi'
rewrite H.Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true IHphi1' : no_negative_occurrence_db_b (S n') phi
→ well_formed_positive phi^[svar:S n'↦psi] IHphi2' : no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:S n'↦psi] &&
well_formed_positive phi' H : no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] Hnopos : no_positive_occurrence_db_b (S n') phi phi' : Pattern Hwfpphi' : well_formed_positive phi'
true && well_formed_positive phi^[svar:S n'↦psi] &&
well_formed_positive phi'
rewrite IHphi2'.Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true IHphi1' : no_negative_occurrence_db_b (S n') phi
→ well_formed_positive phi^[svar:S n'↦psi] IHphi2' : no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:S n'↦psi] &&
well_formed_positive phi' H : no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] Hnopos : no_positive_occurrence_db_b (S n') phi phi' : Pattern Hwfpphi' : well_formed_positive phi'
no_positive_occurrence_db_b (S n') phi
rewrite Hnopos.Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true IHphi1' : no_negative_occurrence_db_b (S n') phi
→ well_formed_positive phi^[svar:S n'↦psi] IHphi2' : no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:S n'↦psi] &&
well_formed_positive phi' H : no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] Hnopos : no_positive_occurrence_db_b (S n') phi phi' : Pattern Hwfpphi' : well_formed_positive phi'
true
2 : rewrite Hwfpphi'.Σ : Signature phi, psi : Pattern Hwfppsi : well_formed_positive psi Hwfcpsi : well_formed_closed_mu_aux psi 0 IHphi : ∀ n : nat,
well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:n↦psi] &&
well_formed_positive phi')n' : nat Hwfpphi1 : no_negative_occurrence_db_b 0 phi = true Hwfpphi2 : well_formed_positive phi = true IHphi1' : no_negative_occurrence_db_b (S n') phi
→ well_formed_positive phi^[svar:S n'↦psi] IHphi2' : no_positive_occurrence_db_b (S n') phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
phi^[svar:S n'↦psi] &&
well_formed_positive phi' H : no_negative_occurrence_db_b 0 phi^[svar:S n'↦psi] Hnopos : no_positive_occurrence_db_b (S n') phi phi' : Pattern Hwfpphi' : well_formed_positive phi'
true
1 ,2 ,3 : auto .
Qed .
Corollary wfp_bsvar_subst (phi psi : Pattern) :
well_formed_positive (patt_mu phi) ->
well_formed_positive psi ->
well_formed_closed_mu_aux psi 0 ->
well_formed_positive (phi^[svar: 0 ↦ psi]).Σ : Signature phi, psi : Pattern
well_formed_positive (patt_mu phi)
→ well_formed_positive psi
→ well_formed_closed_mu_aux psi 0
→ well_formed_positive phi^[svar:0 ↦psi]
Proof .Σ : Signature phi, psi : Pattern
well_formed_positive (patt_mu phi)
→ well_formed_positive psi
→ well_formed_closed_mu_aux psi 0
→ well_formed_positive phi^[svar:0 ↦psi]
intros H1 H2 H3.Σ : Signature phi, psi : Pattern H1 : well_formed_positive (patt_mu phi) H2 : well_formed_positive psi H3 : well_formed_closed_mu_aux psi 0
well_formed_positive phi^[svar:0 ↦psi]
simpl in H1.Σ : Signature phi, psi : Pattern H1 : no_negative_occurrence_db_b 0 phi &&
well_formed_positive phi H2 : well_formed_positive psi H3 : well_formed_closed_mu_aux psi 0
well_formed_positive phi^[svar:0 ↦psi]
eapply elimT in H1.Σ : Signature phi, psi : Pattern H2 : well_formed_positive psi H3 : well_formed_closed_mu_aux psi 0 H1 : ?P
well_formed_positive phi^[svar:0 ↦psi]
2 : apply andP.Σ : Signature phi, psi : Pattern H2 : well_formed_positive psi H3 : well_formed_closed_mu_aux psi 0 H1 : no_negative_occurrence_db_b 0 phi
∧ well_formed_positive phi
well_formed_positive phi^[svar:0 ↦psi]
destruct H1 as [Hnonegphi Hwfpphi].Σ : Signature phi, psi : Pattern H2 : well_formed_positive psi H3 : well_formed_closed_mu_aux psi 0 Hnonegphi : no_negative_occurrence_db_b 0 phi Hwfpphi : well_formed_positive phi
well_formed_positive phi^[svar:0 ↦psi]
pose proof (H4 := Private_wfp_bsvar_subst).Σ : Signature phi, psi : Pattern H2 : well_formed_positive psi H3 : well_formed_closed_mu_aux psi 0 Hnonegphi : no_negative_occurrence_db_b 0 phi Hwfpphi : well_formed_positive phi H4 : ∀ (phi psi : Pattern) (n : nat),
well_formed_positive psi
→ well_formed_closed_mu_aux psi 0
→ well_formed_positive phi
→ (no_negative_occurrence_db_b n phi
→ well_formed_positive phi^[svar:n↦psi])
∧ (no_positive_occurrence_db_b n phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
(patt_imp phi^[svar:n↦psi]
phi'))
well_formed_positive phi^[svar:0 ↦psi]
specialize (H4 phi psi 0 H2 H3 Hwfpphi).Σ : Signature phi, psi : Pattern H2 : well_formed_positive psi H3 : well_formed_closed_mu_aux psi 0 Hnonegphi : no_negative_occurrence_db_b 0 phi Hwfpphi : well_formed_positive phi H4 : (no_negative_occurrence_db_b 0 phi
→ well_formed_positive phi^[svar:0 ↦psi])
∧ (no_positive_occurrence_db_b 0 phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
(patt_imp phi^[svar:0 ↦psi] phi'))
well_formed_positive phi^[svar:0 ↦psi]
destruct H4 as [H41 H42].Σ : Signature phi, psi : Pattern H2 : well_formed_positive psi H3 : well_formed_closed_mu_aux psi 0 Hnonegphi : no_negative_occurrence_db_b 0 phi Hwfpphi : well_formed_positive phi H41 : no_negative_occurrence_db_b 0 phi
→ well_formed_positive phi^[svar:0 ↦psi] H42 : no_positive_occurrence_db_b 0 phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
(patt_imp phi^[svar:0 ↦psi] phi')
well_formed_positive phi^[svar:0 ↦psi]
apply H41.Σ : Signature phi, psi : Pattern H2 : well_formed_positive psi H3 : well_formed_closed_mu_aux psi 0 Hnonegphi : no_negative_occurrence_db_b 0 phi Hwfpphi : well_formed_positive phi H41 : no_negative_occurrence_db_b 0 phi
→ well_formed_positive phi^[svar:0 ↦psi] H42 : no_positive_occurrence_db_b 0 phi
→ ∀ phi' : Pattern,
well_formed_positive phi'
→ well_formed_positive
(patt_imp phi^[svar:0 ↦psi] phi')
no_negative_occurrence_db_b 0 phi
apply Hnonegphi.
Qed .
Lemma bevar_subst_evar_quantify_free_evar x dbi ϕ :
well_formed_closed_ex_aux ϕ dbi ->
(ϕ^{{evar : x ↦ dbi}})^[evar : dbi ↦ patt_free_evar x] = ϕ.Σ : Signature x : evar dbi : db_index ϕ : Pattern
well_formed_closed_ex_aux ϕ dbi
→ ϕ^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x] = ϕ
Proof .Σ : Signature x : evar dbi : db_index ϕ : Pattern
well_formed_closed_ex_aux ϕ dbi
→ ϕ^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x] = ϕ
move : dbi.Σ : Signature x : evar ϕ : Pattern
∀ dbi : db_index,
well_formed_closed_ex_aux ϕ dbi
→ ϕ^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x] = ϕ
induction ϕ; intros dbi Hwf; simpl in *; auto .Σ : Signature x, x0 : evar dbi : db_index Hwf : true
(if decide (x = x0)
then patt_bound_evar dbi
else patt_free_evar x0)^[evar :dbi↦patt_free_evar x] =
patt_free_evar x0
- Σ : Signature x, x0 : evar dbi : db_index Hwf : true
(if decide (x = x0)
then patt_bound_evar dbi
else patt_free_evar x0)^[evar :dbi↦patt_free_evar x] =
patt_free_evar x0
case_match; simpl ;[|reflexivity ]. Σ : Signature x, x0 : evar dbi : db_index Hwf : true e : x = x0 H : decide (x = x0) = left e
match compare_nat dbi dbi with
| Nat_less _ _ _ => patt_bound_evar dbi
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred dbi)
end = patt_free_evar x0
case_match; simpl ; try lia . Σ : Signature x, x0 : evar dbi : db_index Hwf : true e : x = x0 H : decide (x = x0) = left e e0 : dbi = dbi H0 : compare_nat dbi dbi = Nat_equal dbi dbi e0
patt_free_evar x = patt_free_evar x0
subst .Σ : Signature x0 : evar dbi : db_index Hwf : true H : decide (x0 = x0) = left (erefl x0) e0 : dbi = dbi H0 : compare_nat dbi dbi = Nat_equal dbi dbi e0
patt_free_evar x0 = patt_free_evar x0
auto .
- Σ : Signature x : evar n, dbi : db_index Hwf : if decide (n < dbi) then true else false
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end = patt_bound_evar n
do 2 case_match; try lia ; auto .Σ : Signature x : evar n, dbi : db_index n0 : ¬ n < dbi H : decide (n < dbi) = right n0 Hwf : false e : n = dbi H0 : compare_nat n dbi = Nat_equal n dbi e
patt_free_evar x = patt_bound_evar n
congruence .Σ : Signature x : evar n, dbi : db_index n0 : ¬ n < dbi H : decide (n < dbi) = right n0 Hwf : false g : n > dbi H0 : compare_nat n dbi = Nat_greater n dbi g
patt_bound_evar (Nat.pred n) = patt_bound_evar n
congruence .
- Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ1 dbi
→ ϕ1^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ2 dbi
→ ϕ2^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ2dbi : db_index Hwf : well_formed_closed_ex_aux ϕ1 dbi &&
well_formed_closed_ex_aux ϕ2 dbi
patt_app ϕ1^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x]
ϕ2^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x] =
patt_app ϕ1 ϕ2
apply andb_true_iff in Hwf.Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ1 dbi
→ ϕ1^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ2 dbi
→ ϕ2^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ2dbi : db_index Hwf : well_formed_closed_ex_aux ϕ1 dbi = true
∧ well_formed_closed_ex_aux ϕ2 dbi = true
patt_app ϕ1^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x]
ϕ2^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x] =
patt_app ϕ1 ϕ2
destruct_and!. Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ1 dbi
→ ϕ1^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ2 dbi
→ ϕ2^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ2dbi : db_index H : well_formed_closed_ex_aux ϕ1 dbi = true H0 : well_formed_closed_ex_aux ϕ2 dbi = true
patt_app ϕ1^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x]
ϕ2^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x] =
patt_app ϕ1 ϕ2
rewrite IHϕ1;[assumption |].Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ1 dbi
→ ϕ1^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ2 dbi
→ ϕ2^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ2dbi : db_index H : well_formed_closed_ex_aux ϕ1 dbi = true H0 : well_formed_closed_ex_aux ϕ2 dbi = true
patt_app ϕ1
ϕ2^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x] =
patt_app ϕ1 ϕ2
rewrite IHϕ2;[assumption |].Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ1 dbi
→ ϕ1^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ2 dbi
→ ϕ2^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ2dbi : db_index H : well_formed_closed_ex_aux ϕ1 dbi = true H0 : well_formed_closed_ex_aux ϕ2 dbi = true
patt_app ϕ1 ϕ2 = patt_app ϕ1 ϕ2
reflexivity .
- Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ1 dbi
→ ϕ1^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ2 dbi
→ ϕ2^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ2dbi : db_index Hwf : well_formed_closed_ex_aux ϕ1 dbi &&
well_formed_closed_ex_aux ϕ2 dbi
patt_imp ϕ1^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x]
ϕ2^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x] =
patt_imp ϕ1 ϕ2
apply andb_true_iff in Hwf.Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ1 dbi
→ ϕ1^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ2 dbi
→ ϕ2^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ2dbi : db_index Hwf : well_formed_closed_ex_aux ϕ1 dbi = true
∧ well_formed_closed_ex_aux ϕ2 dbi = true
patt_imp ϕ1^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x]
ϕ2^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x] =
patt_imp ϕ1 ϕ2
destruct_and!. Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ1 dbi
→ ϕ1^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ2 dbi
→ ϕ2^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ2dbi : db_index H : well_formed_closed_ex_aux ϕ1 dbi = true H0 : well_formed_closed_ex_aux ϕ2 dbi = true
patt_imp ϕ1^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x]
ϕ2^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x] =
patt_imp ϕ1 ϕ2
rewrite IHϕ1;[assumption |].Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ1 dbi
→ ϕ1^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ2 dbi
→ ϕ2^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ2dbi : db_index H : well_formed_closed_ex_aux ϕ1 dbi = true H0 : well_formed_closed_ex_aux ϕ2 dbi = true
patt_imp ϕ1
ϕ2^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x] =
patt_imp ϕ1 ϕ2
rewrite IHϕ2;[assumption |].Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ1 dbi
→ ϕ1^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ2 dbi
→ ϕ2^{{evar :x↦dbi}}^[evar :dbi↦
patt_free_evar x] = ϕ2dbi : db_index H : well_formed_closed_ex_aux ϕ1 dbi = true H0 : well_formed_closed_ex_aux ϕ2 dbi = true
patt_imp ϕ1 ϕ2 = patt_imp ϕ1 ϕ2
reflexivity .
- Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ dbi
→ ϕ^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x] = ϕdbi : db_index Hwf : well_formed_closed_ex_aux ϕ (S dbi)
patt_exists
ϕ^{{evar :x↦S dbi}}^[evar :S dbi↦patt_free_evar x] =
patt_exists ϕ
rewrite IHϕ;[assumption |reflexivity ].
- Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ dbi : db_index,
well_formed_closed_ex_aux ϕ dbi
→ ϕ^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x] = ϕdbi : db_index Hwf : well_formed_closed_ex_aux ϕ dbi
patt_mu ϕ^{{evar :x↦dbi}}^[evar :dbi↦patt_free_evar x] =
patt_mu ϕ
rewrite IHϕ;[assumption |reflexivity ].
Qed .
Lemma bsvar_subst_svar_quantify_free_svar X dbi ϕ :
well_formed_closed_mu_aux ϕ dbi ->
(ϕ^{{svar: X ↦ dbi}})^[svar: dbi ↦ (patt_free_svar X)] = ϕ.Σ : Signature X : svar dbi : db_index ϕ : Pattern
well_formed_closed_mu_aux ϕ dbi
→ ϕ^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X] = ϕ
Proof .Σ : Signature X : svar dbi : db_index ϕ : Pattern
well_formed_closed_mu_aux ϕ dbi
→ ϕ^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X] = ϕ
move : dbi.Σ : Signature X : svar ϕ : Pattern
∀ dbi : db_index,
well_formed_closed_mu_aux ϕ dbi
→ ϕ^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X] = ϕ
induction ϕ; intros dbi Hwf; simpl in *; auto .Σ : Signature X, x : svar dbi : db_index Hwf : true
(if decide (X = x)
then patt_bound_svar dbi
else patt_free_svar x)^[svar:dbi↦patt_free_svar X] =
patt_free_svar x
- Σ : Signature X, x : svar dbi : db_index Hwf : true
(if decide (X = x)
then patt_bound_svar dbi
else patt_free_svar x)^[svar:dbi↦patt_free_svar X] =
patt_free_svar x
case_match; simpl ;[|reflexivity ]. Σ : Signature X, x : svar dbi : db_index Hwf : true e : X = x H : decide (X = x) = left e
match compare_nat dbi dbi with
| Nat_less _ _ _ => patt_bound_svar dbi
| Nat_equal _ _ _ => patt_free_svar X
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred dbi)
end = patt_free_svar x
case_match; simpl ; try lia . Σ : Signature X, x : svar dbi : db_index Hwf : true e : X = x H : decide (X = x) = left e e0 : dbi = dbi H0 : compare_nat dbi dbi = Nat_equal dbi dbi e0
patt_free_svar X = patt_free_svar x
subst .Σ : Signature x : svar dbi : db_index Hwf : true H : decide (x = x) = left (erefl x) e0 : dbi = dbi H0 : compare_nat dbi dbi = Nat_equal dbi dbi e0
patt_free_svar x = patt_free_svar x
auto .
- Σ : Signature X : svar n, dbi : db_index Hwf : if decide (n < dbi) then true else false
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_svar X
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end = patt_bound_svar n
do 2 case_match; try lia ; auto .Σ : Signature X : svar n, dbi : db_index n0 : ¬ n < dbi H : decide (n < dbi) = right n0 Hwf : false e : n = dbi H0 : compare_nat n dbi = Nat_equal n dbi e
patt_free_svar X = patt_bound_svar n
congruence .Σ : Signature X : svar n, dbi : db_index n0 : ¬ n < dbi H : decide (n < dbi) = right n0 Hwf : false g : n > dbi H0 : compare_nat n dbi = Nat_greater n dbi g
patt_bound_svar (Nat.pred n) = patt_bound_svar n
congruence .
- Σ : Signature X : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ1 dbi
→ ϕ1^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ2 dbi
→ ϕ2^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ϕ1 dbi &&
well_formed_closed_mu_aux ϕ2 dbi
patt_app ϕ1^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X]
ϕ2^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X] =
patt_app ϕ1 ϕ2
apply andb_true_iff in Hwf.Σ : Signature X : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ1 dbi
→ ϕ1^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ2 dbi
→ ϕ2^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ϕ1 dbi = true
∧ well_formed_closed_mu_aux ϕ2 dbi = true
patt_app ϕ1^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X]
ϕ2^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X] =
patt_app ϕ1 ϕ2
destruct_and!. Σ : Signature X : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ1 dbi
→ ϕ1^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ2 dbi
→ ϕ2^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ2dbi : db_index H : well_formed_closed_mu_aux ϕ1 dbi = true H0 : well_formed_closed_mu_aux ϕ2 dbi = true
patt_app ϕ1^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X]
ϕ2^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X] =
patt_app ϕ1 ϕ2
rewrite IHϕ1;[assumption |].Σ : Signature X : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ1 dbi
→ ϕ1^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ2 dbi
→ ϕ2^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ2dbi : db_index H : well_formed_closed_mu_aux ϕ1 dbi = true H0 : well_formed_closed_mu_aux ϕ2 dbi = true
patt_app ϕ1
ϕ2^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X] =
patt_app ϕ1 ϕ2
rewrite IHϕ2;[assumption |].Σ : Signature X : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ1 dbi
→ ϕ1^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ2 dbi
→ ϕ2^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ2dbi : db_index H : well_formed_closed_mu_aux ϕ1 dbi = true H0 : well_formed_closed_mu_aux ϕ2 dbi = true
patt_app ϕ1 ϕ2 = patt_app ϕ1 ϕ2
reflexivity .
- Σ : Signature X : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ1 dbi
→ ϕ1^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ2 dbi
→ ϕ2^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ϕ1 dbi &&
well_formed_closed_mu_aux ϕ2 dbi
patt_imp ϕ1^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X]
ϕ2^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X] =
patt_imp ϕ1 ϕ2
apply andb_true_iff in Hwf.Σ : Signature X : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ1 dbi
→ ϕ1^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ2 dbi
→ ϕ2^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ϕ1 dbi = true
∧ well_formed_closed_mu_aux ϕ2 dbi = true
patt_imp ϕ1^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X]
ϕ2^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X] =
patt_imp ϕ1 ϕ2
destruct_and!. Σ : Signature X : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ1 dbi
→ ϕ1^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ2 dbi
→ ϕ2^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ2dbi : db_index H : well_formed_closed_mu_aux ϕ1 dbi = true H0 : well_formed_closed_mu_aux ϕ2 dbi = true
patt_imp ϕ1^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X]
ϕ2^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X] =
patt_imp ϕ1 ϕ2
rewrite IHϕ1;[assumption |].Σ : Signature X : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ1 dbi
→ ϕ1^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ2 dbi
→ ϕ2^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ2dbi : db_index H : well_formed_closed_mu_aux ϕ1 dbi = true H0 : well_formed_closed_mu_aux ϕ2 dbi = true
patt_imp ϕ1
ϕ2^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X] =
patt_imp ϕ1 ϕ2
rewrite IHϕ2;[assumption |].Σ : Signature X : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ1 dbi
→ ϕ1^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ2 dbi
→ ϕ2^{{svar:X↦dbi}}^[svar:dbi↦
patt_free_svar X] = ϕ2dbi : db_index H : well_formed_closed_mu_aux ϕ1 dbi = true H0 : well_formed_closed_mu_aux ϕ2 dbi = true
patt_imp ϕ1 ϕ2 = patt_imp ϕ1 ϕ2
reflexivity .
- Σ : Signature X : svar ϕ : Pattern IHϕ : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ dbi
→ ϕ^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X] = ϕdbi : db_index Hwf : well_formed_closed_mu_aux ϕ dbi
patt_exists
ϕ^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X] =
patt_exists ϕ
rewrite IHϕ;[assumption |reflexivity ].
- Σ : Signature X : svar ϕ : Pattern IHϕ : ∀ dbi : db_index,
well_formed_closed_mu_aux ϕ dbi
→ ϕ^{{svar:X↦dbi}}^[svar:dbi↦patt_free_svar X] = ϕdbi : db_index Hwf : well_formed_closed_mu_aux ϕ (S dbi)
patt_mu
ϕ^{{svar:X↦S dbi}}^[svar:S dbi↦patt_free_svar X] =
patt_mu ϕ
rewrite IHϕ;[assumption |reflexivity ].
Qed .
Lemma free_svar_subst_fresh phi psi X :
svar_is_fresh_in X phi ->
phi^[[svar: X ↦ psi]] = phi.Σ : Signature phi, psi : Pattern X : svar
svar_is_fresh_in X phi → phi^[[svar:X↦psi]] = phi
Proof .Σ : Signature phi, psi : Pattern X : svar
svar_is_fresh_in X phi → phi^[[svar:X↦psi]] = phi
intros Hfresh.Σ : Signature phi, psi : Pattern X : svar Hfresh : svar_is_fresh_in X phi
phi^[[svar:X↦psi]] = phi
unfold svar_is_fresh_in in Hfresh.Σ : Signature phi, psi : Pattern X : svar Hfresh : X ∉ free_svars phi
phi^[[svar:X↦psi]] = phi
induction phi; simpl in *; auto .Σ : Signature x : svar psi : Pattern X : svar Hfresh : X ∉ {[x]}
(if decide (X = x) then psi else patt_free_svar x) =
patt_free_svar x
- Σ : Signature x : svar psi : Pattern X : svar Hfresh : X ∉ {[x]}
(if decide (X = x) then psi else patt_free_svar x) =
patt_free_svar x
case_match. Σ : Signature x : svar psi : Pattern X : svar Hfresh : X ∉ {[x]} e : X = x H : decide (X = x) = left e
psi = patt_free_svar x
+ Σ : Signature x : svar psi : Pattern X : svar Hfresh : X ∉ {[x]} e : X = x H : decide (X = x) = left e
psi = patt_free_svar x
subst .Σ : Signature x : svar psi : Pattern Hfresh : x ∉ {[x]} H : decide (x = x) = left (erefl x)
psi = patt_free_svar x
set_solver.
+ Σ : Signature x : svar psi : Pattern X : svar Hfresh : X ∉ {[x]} n : X ≠ x H : decide (X = x) = right n
patt_free_svar x = patt_free_svar x
reflexivity .
- Σ : Signature phi1, phi2, psi : Pattern X : svar Hfresh : X ∉ free_svars phi1 ∪ free_svars phi2 IHphi1 : X ∉ free_svars phi1
→ phi1^[[svar:X↦psi]] = phi1 IHphi2 : X ∉ free_svars phi2
→ phi2^[[svar:X↦psi]] = phi2
patt_app phi1^[[svar:X↦psi]] phi2^[[svar:X↦psi]] =
patt_app phi1 phi2
specialize (IHphi1 ltac :(set_solver)).Σ : Signature phi1, phi2, psi : Pattern X : svar Hfresh : X ∉ free_svars phi1 ∪ free_svars phi2 IHphi1 : phi1^[[svar:X↦psi]] = phi1 IHphi2 : X ∉ free_svars phi2
→ phi2^[[svar:X↦psi]] = phi2
patt_app phi1^[[svar:X↦psi]] phi2^[[svar:X↦psi]] =
patt_app phi1 phi2
specialize (IHphi2 ltac :(set_solver)).Σ : Signature phi1, phi2, psi : Pattern X : svar Hfresh : X ∉ free_svars phi1 ∪ free_svars phi2 IHphi1 : phi1^[[svar:X↦psi]] = phi1 IHphi2 : phi2^[[svar:X↦psi]] = phi2
patt_app phi1^[[svar:X↦psi]] phi2^[[svar:X↦psi]] =
patt_app phi1 phi2
rewrite IHphi1.Σ : Signature phi1, phi2, psi : Pattern X : svar Hfresh : X ∉ free_svars phi1 ∪ free_svars phi2 IHphi1 : phi1^[[svar:X↦psi]] = phi1 IHphi2 : phi2^[[svar:X↦psi]] = phi2
patt_app phi1 phi2^[[svar:X↦psi]] = patt_app phi1 phi2
rewrite IHphi2.Σ : Signature phi1, phi2, psi : Pattern X : svar Hfresh : X ∉ free_svars phi1 ∪ free_svars phi2 IHphi1 : phi1^[[svar:X↦psi]] = phi1 IHphi2 : phi2^[[svar:X↦psi]] = phi2
patt_app phi1 phi2 = patt_app phi1 phi2
reflexivity .
- Σ : Signature phi1, phi2, psi : Pattern X : svar Hfresh : X ∉ free_svars phi1 ∪ free_svars phi2 IHphi1 : X ∉ free_svars phi1
→ phi1^[[svar:X↦psi]] = phi1 IHphi2 : X ∉ free_svars phi2
→ phi2^[[svar:X↦psi]] = phi2
patt_imp phi1^[[svar:X↦psi]] phi2^[[svar:X↦psi]] =
patt_imp phi1 phi2
specialize (IHphi1 ltac :(set_solver)).Σ : Signature phi1, phi2, psi : Pattern X : svar Hfresh : X ∉ free_svars phi1 ∪ free_svars phi2 IHphi1 : phi1^[[svar:X↦psi]] = phi1 IHphi2 : X ∉ free_svars phi2
→ phi2^[[svar:X↦psi]] = phi2
patt_imp phi1^[[svar:X↦psi]] phi2^[[svar:X↦psi]] =
patt_imp phi1 phi2
specialize (IHphi2 ltac :(set_solver)).Σ : Signature phi1, phi2, psi : Pattern X : svar Hfresh : X ∉ free_svars phi1 ∪ free_svars phi2 IHphi1 : phi1^[[svar:X↦psi]] = phi1 IHphi2 : phi2^[[svar:X↦psi]] = phi2
patt_imp phi1^[[svar:X↦psi]] phi2^[[svar:X↦psi]] =
patt_imp phi1 phi2
rewrite IHphi1.Σ : Signature phi1, phi2, psi : Pattern X : svar Hfresh : X ∉ free_svars phi1 ∪ free_svars phi2 IHphi1 : phi1^[[svar:X↦psi]] = phi1 IHphi2 : phi2^[[svar:X↦psi]] = phi2
patt_imp phi1 phi2^[[svar:X↦psi]] = patt_imp phi1 phi2
rewrite IHphi2.Σ : Signature phi1, phi2, psi : Pattern X : svar Hfresh : X ∉ free_svars phi1 ∪ free_svars phi2 IHphi1 : phi1^[[svar:X↦psi]] = phi1 IHphi2 : phi2^[[svar:X↦psi]] = phi2
patt_imp phi1 phi2 = patt_imp phi1 phi2
reflexivity .
- Σ : Signature phi, psi : Pattern X : svar Hfresh : X ∉ free_svars phi IHphi : X ∉ free_svars phi → phi^[[svar:X↦psi]] = phi
patt_exists phi^[[svar:X↦psi]] = patt_exists phi
specialize (IHphi ltac :(assumption )).Σ : Signature phi, psi : Pattern X : svar Hfresh : X ∉ free_svars phi IHphi : phi^[[svar:X↦psi]] = phi
patt_exists phi^[[svar:X↦psi]] = patt_exists phi
rewrite IHphi.Σ : Signature phi, psi : Pattern X : svar Hfresh : X ∉ free_svars phi IHphi : phi^[[svar:X↦psi]] = phi
patt_exists phi = patt_exists phi
reflexivity .
- Σ : Signature phi, psi : Pattern X : svar Hfresh : X ∉ free_svars phi IHphi : X ∉ free_svars phi → phi^[[svar:X↦psi]] = phi
patt_mu phi^[[svar:X↦psi]] = patt_mu phi
specialize (IHphi ltac :(assumption )).Σ : Signature phi, psi : Pattern X : svar Hfresh : X ∉ free_svars phi IHphi : phi^[[svar:X↦psi]] = phi
patt_mu phi^[[svar:X↦psi]] = patt_mu phi
rewrite IHphi.Σ : Signature phi, psi : Pattern X : svar Hfresh : X ∉ free_svars phi IHphi : phi^[[svar:X↦psi]] = phi
patt_mu phi = patt_mu phi
reflexivity .
Qed .
Lemma wfc_mu_free_svar_subst level ϕ ψ X :
well_formed_closed_mu_aux ϕ level ->
well_formed_closed_mu_aux ψ level ->
well_formed_closed_mu_aux (ϕ^[[svar: X ↦ ψ]]) level = true.Σ : Signature level : db_index ϕ, ψ : Pattern X : svar
well_formed_closed_mu_aux ϕ level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ^[[svar:X↦ψ]] level =
true
Proof .Σ : Signature level : db_index ϕ, ψ : Pattern X : svar
well_formed_closed_mu_aux ϕ level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ^[[svar:X↦ψ]] level =
true
intros Hϕ Hψ.Σ : Signature level : db_index ϕ, ψ : Pattern X : svar Hϕ : well_formed_closed_mu_aux ϕ level Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux ϕ^[[svar:X↦ψ]] level = true
move : level Hϕ Hψ.Σ : Signature ϕ, ψ : Pattern X : svar
∀ level : db_index,
well_formed_closed_mu_aux ϕ level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ^[[svar:X↦ψ]] level =
true
induction ϕ; intros level Hϕ Hψ; simpl in *; auto with nocore.Σ : Signature x : svar ψ : Pattern X : svar level : db_index Hϕ : true Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux
(if decide (X = x) then ψ else patt_free_svar x)
level = true
- Σ : Signature x : svar ψ : Pattern X : svar level : db_index Hϕ : true Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux
(if decide (X = x) then ψ else patt_free_svar x)
level = true
case_match; [|reflexivity ]. Σ : Signature x : svar ψ : Pattern X : svar level : db_index Hϕ : true Hψ : well_formed_closed_mu_aux ψ level e : X = x H : decide (X = x) = left e
well_formed_closed_mu_aux ψ level = true
assumption .
- Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ1 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ1^[[svar:X↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ2 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ2^[[svar:X↦ψ]]
level = truelevel : db_index Hϕ : well_formed_closed_mu_aux ϕ1 level &&
well_formed_closed_mu_aux ϕ2 level Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux ϕ1^[[svar:X↦ψ]] level &&
well_formed_closed_mu_aux ϕ2^[[svar:X↦ψ]] level = true
destruct_and!. Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ1 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ1^[[svar:X↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ2 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ2^[[svar:X↦ψ]]
level = truelevel : db_index H : well_formed_closed_mu_aux ϕ1 level = true H0 : well_formed_closed_mu_aux ϕ2 level = true Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux ϕ1^[[svar:X↦ψ]] level &&
well_formed_closed_mu_aux ϕ2^[[svar:X↦ψ]] level = true
rewrite IHϕ1; auto with nocore.Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ1 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ1^[[svar:X↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ2 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ2^[[svar:X↦ψ]]
level = truelevel : db_index H : well_formed_closed_mu_aux ϕ1 level = true H0 : well_formed_closed_mu_aux ϕ2 level = true Hψ : well_formed_closed_mu_aux ψ level
true &&
well_formed_closed_mu_aux ϕ2^[[svar:X↦ψ]] level = true
rewrite IHϕ2; auto with nocore.Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ1 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ1^[[svar:X↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ2 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ2^[[svar:X↦ψ]]
level = truelevel : db_index H : well_formed_closed_mu_aux ϕ1 level = true H0 : well_formed_closed_mu_aux ϕ2 level = true Hψ : well_formed_closed_mu_aux ψ level
true && true = true
reflexivity .
- Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ1 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ1^[[svar:X↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ2 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ2^[[svar:X↦ψ]]
level = truelevel : db_index Hϕ : well_formed_closed_mu_aux ϕ1 level &&
well_formed_closed_mu_aux ϕ2 level Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux ϕ1^[[svar:X↦ψ]] level &&
well_formed_closed_mu_aux ϕ2^[[svar:X↦ψ]] level = true
destruct_and!. Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ1 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ1^[[svar:X↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ2 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ2^[[svar:X↦ψ]]
level = truelevel : db_index H : well_formed_closed_mu_aux ϕ1 level = true H0 : well_formed_closed_mu_aux ϕ2 level = true Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux ϕ1^[[svar:X↦ψ]] level &&
well_formed_closed_mu_aux ϕ2^[[svar:X↦ψ]] level = true
rewrite IHϕ1; auto with nocore.Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ1 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ1^[[svar:X↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ2 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ2^[[svar:X↦ψ]]
level = truelevel : db_index H : well_formed_closed_mu_aux ϕ1 level = true H0 : well_formed_closed_mu_aux ϕ2 level = true Hψ : well_formed_closed_mu_aux ψ level
true &&
well_formed_closed_mu_aux ϕ2^[[svar:X↦ψ]] level = true
rewrite IHϕ2; auto with nocore.Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ1 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ1^[[svar:X↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ2 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ2^[[svar:X↦ψ]]
level = truelevel : db_index H : well_formed_closed_mu_aux ϕ1 level = true H0 : well_formed_closed_mu_aux ϕ2 level = true Hψ : well_formed_closed_mu_aux ψ level
true && true = true
reflexivity .
- Σ : Signature ϕ, ψ : Pattern X : svar IHϕ : ∀ level : db_index,
well_formed_closed_mu_aux ϕ level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ^[[svar:X↦ψ]] level = truelevel : db_index Hϕ : well_formed_closed_mu_aux ϕ (S level) Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux ϕ^[[svar:X↦ψ]] (S level) =
true
rewrite IHϕ; auto .Σ : Signature ϕ, ψ : Pattern X : svar IHϕ : ∀ level : db_index,
well_formed_closed_mu_aux ϕ level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ^[[svar:X↦ψ]] level = truelevel : db_index Hϕ : well_formed_closed_mu_aux ϕ (S level) Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux ψ (S level)
eapply well_formed_closed_mu_aux_ind.Σ : Signature ϕ, ψ : Pattern X : svar IHϕ : ∀ level : db_index,
well_formed_closed_mu_aux ϕ level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ^[[svar:X↦ψ]] level = truelevel : db_index Hϕ : well_formed_closed_mu_aux ϕ (S level) Hψ : well_formed_closed_mu_aux ψ level
?ind_svar1 ≤ S level
2 : exact Hψ.Σ : Signature ϕ, ψ : Pattern X : svar IHϕ : ∀ level : db_index,
well_formed_closed_mu_aux ϕ level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ^[[svar:X↦ψ]] level = truelevel : db_index Hϕ : well_formed_closed_mu_aux ϕ (S level) Hψ : well_formed_closed_mu_aux ψ level
level ≤ S level
lia .
Qed .
Lemma wfc_ex_free_svar_subst level ϕ ψ X :
well_formed_closed_ex_aux ϕ level ->
well_formed_closed_ex_aux ψ level ->
well_formed_closed_ex_aux (ϕ^[[svar: X ↦ ψ]]) level = true.Σ : Signature level : db_index ϕ, ψ : Pattern X : svar
well_formed_closed_ex_aux ϕ level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ^[[svar:X↦ψ]] level =
true
Proof .Σ : Signature level : db_index ϕ, ψ : Pattern X : svar
well_formed_closed_ex_aux ϕ level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ^[[svar:X↦ψ]] level =
true
intros Hϕ Hψ.Σ : Signature level : db_index ϕ, ψ : Pattern X : svar Hϕ : well_formed_closed_ex_aux ϕ level Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux ϕ^[[svar:X↦ψ]] level = true
move : level Hϕ Hψ.Σ : Signature ϕ, ψ : Pattern X : svar
∀ level : db_index,
well_formed_closed_ex_aux ϕ level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ^[[svar:X↦ψ]] level =
true
induction ϕ; intros level Hϕ Hψ; simpl in *; auto .Σ : Signature x : svar ψ : Pattern X : svar level : db_index Hϕ : true Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux
(if decide (X = x) then ψ else patt_free_svar x)
level = true
- Σ : Signature x : svar ψ : Pattern X : svar level : db_index Hϕ : true Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux
(if decide (X = x) then ψ else patt_free_svar x)
level = true
case_match; [|reflexivity ]. Σ : Signature x : svar ψ : Pattern X : svar level : db_index Hϕ : true Hψ : well_formed_closed_ex_aux ψ level e : X = x H : decide (X = x) = left e
well_formed_closed_ex_aux ψ level = true
assumption .
- Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ1 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ1^[[svar:X↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ2 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ2^[[svar:X↦ψ]]
level = truelevel : db_index Hϕ : well_formed_closed_ex_aux ϕ1 level &&
well_formed_closed_ex_aux ϕ2 level Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux ϕ1^[[svar:X↦ψ]] level &&
well_formed_closed_ex_aux ϕ2^[[svar:X↦ψ]] level = true
destruct_and!. Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ1 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ1^[[svar:X↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ2 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ2^[[svar:X↦ψ]]
level = truelevel : db_index H : well_formed_closed_ex_aux ϕ1 level = true H0 : well_formed_closed_ex_aux ϕ2 level = true Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux ϕ1^[[svar:X↦ψ]] level &&
well_formed_closed_ex_aux ϕ2^[[svar:X↦ψ]] level = true
rewrite IHϕ1; auto with nocore.Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ1 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ1^[[svar:X↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ2 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ2^[[svar:X↦ψ]]
level = truelevel : db_index H : well_formed_closed_ex_aux ϕ1 level = true H0 : well_formed_closed_ex_aux ϕ2 level = true Hψ : well_formed_closed_ex_aux ψ level
true &&
well_formed_closed_ex_aux ϕ2^[[svar:X↦ψ]] level = true
rewrite IHϕ2; auto with nocore.Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ1 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ1^[[svar:X↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ2 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ2^[[svar:X↦ψ]]
level = truelevel : db_index H : well_formed_closed_ex_aux ϕ1 level = true H0 : well_formed_closed_ex_aux ϕ2 level = true Hψ : well_formed_closed_ex_aux ψ level
true && true = true
reflexivity .
- Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ1 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ1^[[svar:X↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ2 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ2^[[svar:X↦ψ]]
level = truelevel : db_index Hϕ : well_formed_closed_ex_aux ϕ1 level &&
well_formed_closed_ex_aux ϕ2 level Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux ϕ1^[[svar:X↦ψ]] level &&
well_formed_closed_ex_aux ϕ2^[[svar:X↦ψ]] level = true
destruct_and!. Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ1 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ1^[[svar:X↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ2 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ2^[[svar:X↦ψ]]
level = truelevel : db_index H : well_formed_closed_ex_aux ϕ1 level = true H0 : well_formed_closed_ex_aux ϕ2 level = true Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux ϕ1^[[svar:X↦ψ]] level &&
well_formed_closed_ex_aux ϕ2^[[svar:X↦ψ]] level = true
rewrite IHϕ1; auto with nocore.Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ1 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ1^[[svar:X↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ2 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ2^[[svar:X↦ψ]]
level = truelevel : db_index H : well_formed_closed_ex_aux ϕ1 level = true H0 : well_formed_closed_ex_aux ϕ2 level = true Hψ : well_formed_closed_ex_aux ψ level
true &&
well_formed_closed_ex_aux ϕ2^[[svar:X↦ψ]] level = true
rewrite IHϕ2; auto with nocore.Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ1 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ1^[[svar:X↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ2 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ2^[[svar:X↦ψ]]
level = truelevel : db_index H : well_formed_closed_ex_aux ϕ1 level = true H0 : well_formed_closed_ex_aux ϕ2 level = true Hψ : well_formed_closed_ex_aux ψ level
true && true = true
reflexivity .
- Σ : Signature ϕ, ψ : Pattern X : svar IHϕ : ∀ level : db_index,
well_formed_closed_ex_aux ϕ level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ^[[svar:X↦ψ]] level = truelevel : db_index Hϕ : well_formed_closed_ex_aux ϕ (S level) Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux ϕ^[[svar:X↦ψ]] (S level) =
true
rewrite IHϕ; auto .Σ : Signature ϕ, ψ : Pattern X : svar IHϕ : ∀ level : db_index,
well_formed_closed_ex_aux ϕ level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ^[[svar:X↦ψ]] level = truelevel : db_index Hϕ : well_formed_closed_ex_aux ϕ (S level) Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux ψ (S level)
eapply well_formed_closed_ex_aux_ind.Σ : Signature ϕ, ψ : Pattern X : svar IHϕ : ∀ level : db_index,
well_formed_closed_ex_aux ϕ level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ^[[svar:X↦ψ]] level = truelevel : db_index Hϕ : well_formed_closed_ex_aux ϕ (S level) Hψ : well_formed_closed_ex_aux ψ level
?ind_evar1 ≤ S level
2 : exact Hψ.Σ : Signature ϕ, ψ : Pattern X : svar IHϕ : ∀ level : db_index,
well_formed_closed_ex_aux ϕ level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ^[[svar:X↦ψ]] level = truelevel : db_index Hϕ : well_formed_closed_ex_aux ϕ (S level) Hψ : well_formed_closed_ex_aux ψ level
level ≤ S level
lia .
Qed .
Lemma wfc_ex_free_evar_subst_2 level ϕ ψ x :
well_formed_closed_ex_aux ϕ level ->
well_formed_closed_ex_aux ψ level ->
well_formed_closed_ex_aux (ϕ^[[evar : x ↦ ψ]]) level = true.Σ : Signature level : db_index ϕ, ψ : Pattern x : evar
well_formed_closed_ex_aux ϕ level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ^[[evar :x↦ψ]] level =
true
Proof .Σ : Signature level : db_index ϕ, ψ : Pattern x : evar
well_formed_closed_ex_aux ϕ level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ^[[evar :x↦ψ]] level =
true
intros Hϕ Hψ.Σ : Signature level : db_index ϕ, ψ : Pattern x : evar Hϕ : well_formed_closed_ex_aux ϕ level Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux ϕ^[[evar :x↦ψ]] level = true
move : level Hϕ Hψ.Σ : Signature ϕ, ψ : Pattern x : evar
∀ level : db_index,
well_formed_closed_ex_aux ϕ level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ^[[evar :x↦ψ]] level =
true
induction ϕ; intros level Hϕ Hψ; simpl in *; auto .Σ : Signature x0 : evar ψ : Pattern x : evar level : db_index Hϕ : true Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux
(if decide (x = x0) then ψ else patt_free_evar x0)
level = true
- Σ : Signature x0 : evar ψ : Pattern x : evar level : db_index Hϕ : true Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux
(if decide (x = x0) then ψ else patt_free_evar x0)
level = true
case_match; [|reflexivity ]. Σ : Signature x0 : evar ψ : Pattern x : evar level : db_index Hϕ : true Hψ : well_formed_closed_ex_aux ψ level e : x = x0 H : decide (x = x0) = left e
well_formed_closed_ex_aux ψ level = true
repeat case_match; auto .
- Σ : Signature ϕ1, ϕ2, ψ : Pattern x : evar IHϕ1 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ1 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ1^[[evar :x↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ2 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ2^[[evar :x↦ψ]]
level = truelevel : db_index Hϕ : well_formed_closed_ex_aux ϕ1 level &&
well_formed_closed_ex_aux ϕ2 level Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux ϕ1^[[evar :x↦ψ]] level &&
well_formed_closed_ex_aux ϕ2^[[evar :x↦ψ]] level = true
destruct_and!. Σ : Signature ϕ1, ϕ2, ψ : Pattern x : evar IHϕ1 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ1 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ1^[[evar :x↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ2 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ2^[[evar :x↦ψ]]
level = truelevel : db_index H : well_formed_closed_ex_aux ϕ1 level = true H0 : well_formed_closed_ex_aux ϕ2 level = true Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux ϕ1^[[evar :x↦ψ]] level &&
well_formed_closed_ex_aux ϕ2^[[evar :x↦ψ]] level = true
rewrite IHϕ1; auto with nocore.Σ : Signature ϕ1, ϕ2, ψ : Pattern x : evar IHϕ1 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ1 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ1^[[evar :x↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ2 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ2^[[evar :x↦ψ]]
level = truelevel : db_index H : well_formed_closed_ex_aux ϕ1 level = true H0 : well_formed_closed_ex_aux ϕ2 level = true Hψ : well_formed_closed_ex_aux ψ level
true &&
well_formed_closed_ex_aux ϕ2^[[evar :x↦ψ]] level = true
rewrite IHϕ2; auto with nocore.Σ : Signature ϕ1, ϕ2, ψ : Pattern x : evar IHϕ1 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ1 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ1^[[evar :x↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ2 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ2^[[evar :x↦ψ]]
level = truelevel : db_index H : well_formed_closed_ex_aux ϕ1 level = true H0 : well_formed_closed_ex_aux ϕ2 level = true Hψ : well_formed_closed_ex_aux ψ level
true && true = true
reflexivity .
- Σ : Signature ϕ1, ϕ2, ψ : Pattern x : evar IHϕ1 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ1 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ1^[[evar :x↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ2 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ2^[[evar :x↦ψ]]
level = truelevel : db_index Hϕ : well_formed_closed_ex_aux ϕ1 level &&
well_formed_closed_ex_aux ϕ2 level Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux ϕ1^[[evar :x↦ψ]] level &&
well_formed_closed_ex_aux ϕ2^[[evar :x↦ψ]] level = true
destruct_and!. Σ : Signature ϕ1, ϕ2, ψ : Pattern x : evar IHϕ1 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ1 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ1^[[evar :x↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ2 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ2^[[evar :x↦ψ]]
level = truelevel : db_index H : well_formed_closed_ex_aux ϕ1 level = true H0 : well_formed_closed_ex_aux ϕ2 level = true Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux ϕ1^[[evar :x↦ψ]] level &&
well_formed_closed_ex_aux ϕ2^[[evar :x↦ψ]] level = true
rewrite IHϕ1; auto with nocore.Σ : Signature ϕ1, ϕ2, ψ : Pattern x : evar IHϕ1 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ1 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ1^[[evar :x↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ2 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ2^[[evar :x↦ψ]]
level = truelevel : db_index H : well_formed_closed_ex_aux ϕ1 level = true H0 : well_formed_closed_ex_aux ϕ2 level = true Hψ : well_formed_closed_ex_aux ψ level
true &&
well_formed_closed_ex_aux ϕ2^[[evar :x↦ψ]] level = true
rewrite IHϕ2; auto with nocore.Σ : Signature ϕ1, ϕ2, ψ : Pattern x : evar IHϕ1 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ1 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ1^[[evar :x↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_ex_aux ϕ2 level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ2^[[evar :x↦ψ]]
level = truelevel : db_index H : well_formed_closed_ex_aux ϕ1 level = true H0 : well_formed_closed_ex_aux ϕ2 level = true Hψ : well_formed_closed_ex_aux ψ level
true && true = true
reflexivity .
- Σ : Signature ϕ, ψ : Pattern x : evar IHϕ : ∀ level : db_index,
well_formed_closed_ex_aux ϕ level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ^[[evar :x↦ψ]] level = truelevel : db_index Hϕ : well_formed_closed_ex_aux ϕ (S level) Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux ϕ^[[evar :x↦ψ]] (S level) =
true
rewrite IHϕ; auto .Σ : Signature ϕ, ψ : Pattern x : evar IHϕ : ∀ level : db_index,
well_formed_closed_ex_aux ϕ level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ^[[evar :x↦ψ]] level = truelevel : db_index Hϕ : well_formed_closed_ex_aux ϕ (S level) Hψ : well_formed_closed_ex_aux ψ level
well_formed_closed_ex_aux ψ (S level)
eapply well_formed_closed_ex_aux_ind.Σ : Signature ϕ, ψ : Pattern x : evar IHϕ : ∀ level : db_index,
well_formed_closed_ex_aux ϕ level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ^[[evar :x↦ψ]] level = truelevel : db_index Hϕ : well_formed_closed_ex_aux ϕ (S level) Hψ : well_formed_closed_ex_aux ψ level
?ind_evar1 ≤ S level
2 : exact Hψ.Σ : Signature ϕ, ψ : Pattern x : evar IHϕ : ∀ level : db_index,
well_formed_closed_ex_aux ϕ level
→ well_formed_closed_ex_aux ψ level
→ well_formed_closed_ex_aux ϕ^[[evar :x↦ψ]] level = truelevel : db_index Hϕ : well_formed_closed_ex_aux ϕ (S level) Hψ : well_formed_closed_ex_aux ψ level
level ≤ S level
lia .
Qed .
Lemma wfc_mu_free_evar_subst level ϕ ψ x :
well_formed_closed_mu_aux ϕ level ->
well_formed_closed_mu_aux ψ level ->
well_formed_closed_mu_aux (ϕ^[[evar : x ↦ ψ]]) level = true.Σ : Signature level : db_index ϕ, ψ : Pattern x : evar
well_formed_closed_mu_aux ϕ level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ^[[evar :x↦ψ]] level =
true
Proof .Σ : Signature level : db_index ϕ, ψ : Pattern x : evar
well_formed_closed_mu_aux ϕ level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ^[[evar :x↦ψ]] level =
true
intros Hϕ Hψ.Σ : Signature level : db_index ϕ, ψ : Pattern x : evar Hϕ : well_formed_closed_mu_aux ϕ level Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux ϕ^[[evar :x↦ψ]] level = true
move : level Hϕ Hψ.Σ : Signature ϕ, ψ : Pattern x : evar
∀ level : db_index,
well_formed_closed_mu_aux ϕ level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ^[[evar :x↦ψ]] level =
true
induction ϕ; intros level Hϕ Hψ; simpl in *; auto .Σ : Signature x0 : evar ψ : Pattern x : evar level : db_index Hϕ : true Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux
(if decide (x = x0) then ψ else patt_free_evar x0)
level = true
- Σ : Signature x0 : evar ψ : Pattern x : evar level : db_index Hϕ : true Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux
(if decide (x = x0) then ψ else patt_free_evar x0)
level = true
case_match; [|reflexivity ]. Σ : Signature x0 : evar ψ : Pattern x : evar level : db_index Hϕ : true Hψ : well_formed_closed_mu_aux ψ level e : x = x0 H : decide (x = x0) = left e
well_formed_closed_mu_aux ψ level = true
assumption .
- Σ : Signature ϕ1, ϕ2, ψ : Pattern x : evar IHϕ1 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ1 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ1^[[evar :x↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ2 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ2^[[evar :x↦ψ]]
level = truelevel : db_index Hϕ : well_formed_closed_mu_aux ϕ1 level &&
well_formed_closed_mu_aux ϕ2 level Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux ϕ1^[[evar :x↦ψ]] level &&
well_formed_closed_mu_aux ϕ2^[[evar :x↦ψ]] level = true
destruct_and!. Σ : Signature ϕ1, ϕ2, ψ : Pattern x : evar IHϕ1 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ1 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ1^[[evar :x↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ2 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ2^[[evar :x↦ψ]]
level = truelevel : db_index H : well_formed_closed_mu_aux ϕ1 level = true H0 : well_formed_closed_mu_aux ϕ2 level = true Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux ϕ1^[[evar :x↦ψ]] level &&
well_formed_closed_mu_aux ϕ2^[[evar :x↦ψ]] level = true
rewrite IHϕ1; auto with nocore.Σ : Signature ϕ1, ϕ2, ψ : Pattern x : evar IHϕ1 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ1 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ1^[[evar :x↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ2 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ2^[[evar :x↦ψ]]
level = truelevel : db_index H : well_formed_closed_mu_aux ϕ1 level = true H0 : well_formed_closed_mu_aux ϕ2 level = true Hψ : well_formed_closed_mu_aux ψ level
true &&
well_formed_closed_mu_aux ϕ2^[[evar :x↦ψ]] level = true
rewrite IHϕ2; auto with nocore.Σ : Signature ϕ1, ϕ2, ψ : Pattern x : evar IHϕ1 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ1 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ1^[[evar :x↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ2 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ2^[[evar :x↦ψ]]
level = truelevel : db_index H : well_formed_closed_mu_aux ϕ1 level = true H0 : well_formed_closed_mu_aux ϕ2 level = true Hψ : well_formed_closed_mu_aux ψ level
true && true = true
reflexivity .
- Σ : Signature ϕ1, ϕ2, ψ : Pattern x : evar IHϕ1 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ1 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ1^[[evar :x↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ2 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ2^[[evar :x↦ψ]]
level = truelevel : db_index Hϕ : well_formed_closed_mu_aux ϕ1 level &&
well_formed_closed_mu_aux ϕ2 level Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux ϕ1^[[evar :x↦ψ]] level &&
well_formed_closed_mu_aux ϕ2^[[evar :x↦ψ]] level = true
destruct_and!. Σ : Signature ϕ1, ϕ2, ψ : Pattern x : evar IHϕ1 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ1 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ1^[[evar :x↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ2 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ2^[[evar :x↦ψ]]
level = truelevel : db_index H : well_formed_closed_mu_aux ϕ1 level = true H0 : well_formed_closed_mu_aux ϕ2 level = true Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux ϕ1^[[evar :x↦ψ]] level &&
well_formed_closed_mu_aux ϕ2^[[evar :x↦ψ]] level = true
rewrite IHϕ1; auto with nocore.Σ : Signature ϕ1, ϕ2, ψ : Pattern x : evar IHϕ1 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ1 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ1^[[evar :x↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ2 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ2^[[evar :x↦ψ]]
level = truelevel : db_index H : well_formed_closed_mu_aux ϕ1 level = true H0 : well_formed_closed_mu_aux ϕ2 level = true Hψ : well_formed_closed_mu_aux ψ level
true &&
well_formed_closed_mu_aux ϕ2^[[evar :x↦ψ]] level = true
rewrite IHϕ2; auto with nocore.Σ : Signature ϕ1, ϕ2, ψ : Pattern x : evar IHϕ1 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ1 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ1^[[evar :x↦ψ]]
level = trueIHϕ2 : ∀ level : db_index,
well_formed_closed_mu_aux ϕ2 level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ2^[[evar :x↦ψ]]
level = truelevel : db_index H : well_formed_closed_mu_aux ϕ1 level = true H0 : well_formed_closed_mu_aux ϕ2 level = true Hψ : well_formed_closed_mu_aux ψ level
true && true = true
reflexivity .
- Σ : Signature ϕ, ψ : Pattern x : evar IHϕ : ∀ level : db_index,
well_formed_closed_mu_aux ϕ level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ^[[evar :x↦ψ]] level = truelevel : db_index Hϕ : well_formed_closed_mu_aux ϕ (S level) Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux ϕ^[[evar :x↦ψ]] (S level) =
true
apply IHϕ; auto .Σ : Signature ϕ, ψ : Pattern x : evar IHϕ : ∀ level : db_index,
well_formed_closed_mu_aux ϕ level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ^[[evar :x↦ψ]] level = truelevel : db_index Hϕ : well_formed_closed_mu_aux ϕ (S level) Hψ : well_formed_closed_mu_aux ψ level
well_formed_closed_mu_aux ψ (S level)
eapply well_formed_closed_mu_aux_ind.Σ : Signature ϕ, ψ : Pattern x : evar IHϕ : ∀ level : db_index,
well_formed_closed_mu_aux ϕ level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ^[[evar :x↦ψ]] level = truelevel : db_index Hϕ : well_formed_closed_mu_aux ϕ (S level) Hψ : well_formed_closed_mu_aux ψ level
?ind_svar1 ≤ S level
2 : eassumption .Σ : Signature ϕ, ψ : Pattern x : evar IHϕ : ∀ level : db_index,
well_formed_closed_mu_aux ϕ level
→ well_formed_closed_mu_aux ψ level
→ well_formed_closed_mu_aux ϕ^[[evar :x↦ψ]] level = truelevel : db_index Hϕ : well_formed_closed_mu_aux ϕ (S level) Hψ : well_formed_closed_mu_aux ψ level
level ≤ S level
lia .
Qed .
Lemma wf_evar_open_from_wf_ex x ϕ :
well_formed (patt_exists ϕ) ->
well_formed (ϕ^{evar : 0 ↦ x}).Σ : Signature x : evar ϕ : Pattern
well_formed (patt_exists ϕ) → well_formed ϕ^{evar :0 ↦x}
Proof .Σ : Signature x : evar ϕ : Pattern
well_formed (patt_exists ϕ) → well_formed ϕ^{evar :0 ↦x}
intros H.Σ : Signature x : evar ϕ : Pattern H : well_formed (patt_exists ϕ)
well_formed ϕ^{evar :0 ↦x}
unfold well_formed, well_formed_closed in *.Σ : Signature x : evar ϕ : Pattern H : [&& well_formed_positive (patt_exists ϕ),
well_formed_closed_mu_aux (patt_exists ϕ) 0
& well_formed_closed_ex_aux (patt_exists ϕ) 0 ]
[&& well_formed_positive ϕ^{evar :0 ↦x},
well_formed_closed_mu_aux ϕ^{evar :0 ↦x} 0
& well_formed_closed_ex_aux ϕ^{evar :0 ↦x} 0 ]
destruct_and!. Σ : Signature x : evar ϕ : Pattern H0 : well_formed_positive (patt_exists ϕ) = true H : well_formed_closed_mu_aux (patt_exists ϕ) 0 = true H2 : well_formed_closed_ex_aux (patt_exists ϕ) 0 =
true
[&& well_formed_positive ϕ^{evar :0 ↦x},
well_formed_closed_mu_aux ϕ^{evar :0 ↦x} 0
& well_formed_closed_ex_aux ϕ^{evar :0 ↦x} 0 ]
cbn in *.Σ : Signature x : evar ϕ : Pattern H0 : well_formed_positive ϕ = true H : well_formed_closed_mu_aux ϕ 0 = true H2 : well_formed_closed_ex_aux ϕ 1 = true
[&& well_formed_positive ϕ^{evar :0 ↦x},
well_formed_closed_mu_aux ϕ^{evar :0 ↦x} 0
& well_formed_closed_ex_aux ϕ^{evar :0 ↦x} 0 ]
split_and!. Σ : Signature x : evar ϕ : Pattern H0 : well_formed_positive ϕ = true H : well_formed_closed_mu_aux ϕ 0 = true H2 : well_formed_closed_ex_aux ϕ 1 = true
well_formed_positive ϕ^{evar :0 ↦x} = true
- Σ : Signature x : evar ϕ : Pattern H0 : well_formed_positive ϕ = true H : well_formed_closed_mu_aux ϕ 0 = true H2 : well_formed_closed_ex_aux ϕ 1 = true
well_formed_positive ϕ^{evar :0 ↦x} = true
apply wfp_evar_open.Σ : Signature x : evar ϕ : Pattern H0 : well_formed_positive ϕ = true H : well_formed_closed_mu_aux ϕ 0 = true H2 : well_formed_closed_ex_aux ϕ 1 = true
well_formed_positive ϕ = true
assumption .
- Σ : Signature x : evar ϕ : Pattern H0 : well_formed_positive ϕ = true H : well_formed_closed_mu_aux ϕ 0 = true H2 : well_formed_closed_ex_aux ϕ 1 = true
well_formed_closed_mu_aux ϕ^{evar :0 ↦x} 0 = true
apply wfc_mu_aux_body_ex_imp1.Σ : Signature x : evar ϕ : Pattern H0 : well_formed_positive ϕ = true H : well_formed_closed_mu_aux ϕ 0 = true H2 : well_formed_closed_ex_aux ϕ 1 = true
well_formed_closed_mu_aux ϕ 0 = true
assumption .
- Σ : Signature x : evar ϕ : Pattern H0 : well_formed_positive ϕ = true H : well_formed_closed_mu_aux ϕ 0 = true H2 : well_formed_closed_ex_aux ϕ 1 = true
well_formed_closed_ex_aux ϕ^{evar :0 ↦x} 0 = true
apply wfc_mu_aux_body_ex_imp3.Σ : Signature x : evar ϕ : Pattern H0 : well_formed_positive ϕ = true H : well_formed_closed_mu_aux ϕ 0 = true H2 : well_formed_closed_ex_aux ϕ 1 = true
0 ≤ 0
lia .Σ : Signature x : evar ϕ : Pattern H0 : well_formed_positive ϕ = true H : well_formed_closed_mu_aux ϕ 0 = true H2 : well_formed_closed_ex_aux ϕ 1 = true
well_formed_closed_ex_aux ϕ 1 = true
assumption .
Qed .
Lemma evar_open_size' :
forall (k : db_index) (n : evar ) (p : Pattern),
size' (p^{evar : k ↦ n}) = size' p.Σ : Signature
∀ (k : db_index) (n : evar ) (p : Pattern),
size' p^{evar :k↦n} = size' p
Proof .Σ : Signature
∀ (k : db_index) (n : evar ) (p : Pattern),
size' p^{evar :k↦n} = size' p
intros k n p.Σ : Signature k : db_index n : evar p : Pattern
size' p^{evar :k↦n} = size' p
generalize dependent k.Σ : Signature n : evar p : Pattern
∀ k : db_index, size' p^{evar :k↦n} = size' p
induction p; intros k; cbn ; try reflexivity .Σ : Signature n : evar n0, k : db_index
size'
match compare_nat n0 k with
| Nat_less _ _ _ => patt_bound_evar n0
| Nat_equal _ _ _ => patt_free_evar n
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n0)
end = 1
break_match_goal; reflexivity . Σ : Signature n : evar p1, p2 : Pattern IHp1 : ∀ k : db_index, size' p1^{evar :k↦n} = size' p1IHp2 : ∀ k : db_index, size' p2^{evar :k↦n} = size' p2k : db_index
S
(size' p1^[evar :k↦patt_free_evar n] +
size' p2^[evar :k↦patt_free_evar n]) =
S (size' p1 + size' p2)
rewrite (IHp1 k); rewrite (IHp2 k); reflexivity .Σ : Signature n : evar p1, p2 : Pattern IHp1 : ∀ k : db_index, size' p1^{evar :k↦n} = size' p1IHp2 : ∀ k : db_index, size' p2^{evar :k↦n} = size' p2k : db_index
S
(size' p1^[evar :k↦patt_free_evar n] +
size' p2^[evar :k↦patt_free_evar n]) =
S (size' p1 + size' p2)
rewrite (IHp1 k); rewrite (IHp2 k); reflexivity .Σ : Signature n : evar p : Pattern IHp : ∀ k : db_index, size' p^{evar :k↦n} = size' pk : db_index
S (size' p^[evar :S k↦patt_free_evar n]) = S (size' p)
rewrite (IHp (S k)); reflexivity .Σ : Signature n : evar p : Pattern IHp : ∀ k : db_index, size' p^{evar :k↦n} = size' pk : db_index
S (size' p^[evar :k↦patt_free_evar n]) = S (size' p)
rewrite (IHp k); reflexivity .
Qed .
Lemma svar_open_size' :
forall (k : db_index) (n : svar) (p : Pattern),
size' (p^{svar: k ↦ n}) = size' p.Σ : Signature
∀ (k : db_index) (n : svar) (p : Pattern),
size' p^{svar:k↦n} = size' p
Proof .Σ : Signature
∀ (k : db_index) (n : svar) (p : Pattern),
size' p^{svar:k↦n} = size' p
intros k n p.Σ : Signature k : db_index n : svar p : Pattern
size' p^{svar:k↦n} = size' p
generalize dependent k.Σ : Signature n : svar p : Pattern
∀ k : db_index, size' p^{svar:k↦n} = size' p
induction p; intros k; cbn ; try reflexivity .Σ : Signature n : svar n0, k : db_index
size'
match compare_nat n0 k with
| Nat_less _ _ _ => patt_bound_svar n0
| Nat_equal _ _ _ => patt_free_svar n
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n0)
end = 1
break_match_goal; reflexivity . Σ : Signature n : svar p1, p2 : Pattern IHp1 : ∀ k : db_index, size' p1^{svar:k↦n} = size' p1IHp2 : ∀ k : db_index, size' p2^{svar:k↦n} = size' p2k : db_index
S
(size' p1^[svar:k↦patt_free_svar n] +
size' p2^[svar:k↦patt_free_svar n]) =
S (size' p1 + size' p2)
rewrite (IHp1 k); rewrite (IHp2 k); reflexivity .Σ : Signature n : svar p1, p2 : Pattern IHp1 : ∀ k : db_index, size' p1^{svar:k↦n} = size' p1IHp2 : ∀ k : db_index, size' p2^{svar:k↦n} = size' p2k : db_index
S
(size' p1^[svar:k↦patt_free_svar n] +
size' p2^[svar:k↦patt_free_svar n]) =
S (size' p1 + size' p2)
rewrite (IHp1 k); rewrite (IHp2 k); reflexivity .Σ : Signature n : svar p : Pattern IHp : ∀ k : db_index, size' p^{svar:k↦n} = size' pk : db_index
S (size' p^[svar:k↦patt_free_svar n]) = S (size' p)
rewrite (IHp k); reflexivity .Σ : Signature n : svar p : Pattern IHp : ∀ k : db_index, size' p^{svar:k↦n} = size' pk : db_index
S (size' p^[svar:S k↦patt_free_svar n]) = S (size' p)
rewrite (IHp (S k)); reflexivity .
Qed .
Definition bcmcloseex
(l : list (prod db_index evar ))
(ϕ : Pattern) : Pattern
:= fold_left (λ ϕ' p , ϕ'^{evar : p.1 ↦ p.2 }) l ϕ.
Lemma bcmcloseex_append (l₁ l₂ : list (prod db_index evar )) (ϕ : Pattern) :
bcmcloseex (l₁ ++ l₂) ϕ = bcmcloseex l₂ (bcmcloseex l₁ ϕ).Σ : Signature l₁, l₂ : list (db_index * evar ) ϕ : Pattern
bcmcloseex (l₁ ++ l₂) ϕ =
bcmcloseex l₂ (bcmcloseex l₁ ϕ)
Proof .Σ : Signature l₁, l₂ : list (db_index * evar ) ϕ : Pattern
bcmcloseex (l₁ ++ l₂) ϕ =
bcmcloseex l₂ (bcmcloseex l₁ ϕ)
unfold bcmcloseex.Σ : Signature l₁, l₂ : list (db_index * evar ) ϕ : Pattern
fold_left
(λ (ϕ' : Pattern) (p : db_index * evar ),
ϕ'^{evar :p.1 ↦p.2 }) (l₁ ++ l₂) ϕ =
fold_left
(λ (ϕ' : Pattern) (p : db_index * evar ),
ϕ'^{evar :p.1 ↦p.2 }) l₂
(fold_left
(λ (ϕ' : Pattern) (p : db_index * evar ),
ϕ'^{evar :p.1 ↦p.2 }) l₁ ϕ)
rewrite fold_left_app.Σ : Signature l₁, l₂ : list (db_index * evar ) ϕ : Pattern
fold_left
(λ (ϕ' : Pattern) (p : db_index * evar ),
ϕ'^{evar :p.1 ↦p.2 }) l₂
(fold_left
(λ (ϕ' : Pattern) (p : db_index * evar ),
ϕ'^{evar :p.1 ↦p.2 }) l₁ ϕ) =
fold_left
(λ (ϕ' : Pattern) (p : db_index * evar ),
ϕ'^{evar :p.1 ↦p.2 }) l₂
(fold_left
(λ (ϕ' : Pattern) (p : db_index * evar ),
ϕ'^{evar :p.1 ↦p.2 }) l₁ ϕ)
reflexivity .
Qed .
(*
Lemma bmcloseex_wfcex
{Σ : Signature}
(l : list (prod db_index evar))
(ϕ : Pattern)
: well_formed_closed_ex_aux ϕ from ->
(bcmcloseex from l ϕ) = ϕ.
Proof.
intros H.
induction l.
{ reflexivity. }
{ simpl. rewrite IHl. by rewrite evar_open_not_occur. }
Qed.
*)
Lemma bcmcloseex_bott
(l : list (prod db_index evar ))
: bcmcloseex l patt_bott = patt_bott.Σ : Signature l : list (db_index * evar )
bcmcloseex l patt_bott = patt_bott
Proof .Σ : Signature l : list (db_index * evar )
bcmcloseex l patt_bott = patt_bott
induction l.Σ : Signature
bcmcloseex [] patt_bott = patt_bott
{ Σ : Signature
bcmcloseex [] patt_bott = patt_bott
reflexivity . } Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : bcmcloseex l patt_bott = patt_bott
bcmcloseex (a :: l) patt_bott = patt_bott
{ Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : bcmcloseex l patt_bott = patt_bott
bcmcloseex (a :: l) patt_bott = patt_bott
simpl .Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : bcmcloseex l patt_bott = patt_bott
bcmcloseex l patt_bott^{evar :a.1 ↦a.2 } = patt_bott
rewrite IHl.Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : bcmcloseex l patt_bott = patt_bott
patt_bott = patt_bott
reflexivity . }
Qed .
Lemma bcmcloseex_sym
(l : list (prod db_index evar ))
(s : symbols)
: bcmcloseex l (patt_sym s) = (patt_sym s).Σ : Signature l : list (db_index * evar ) s : symbols
bcmcloseex l (patt_sym s) = patt_sym s
Proof .Σ : Signature l : list (db_index * evar ) s : symbols
bcmcloseex l (patt_sym s) = patt_sym s
induction l.Σ : Signature s : symbols
bcmcloseex [] (patt_sym s) = patt_sym s
{ Σ : Signature s : symbols
bcmcloseex [] (patt_sym s) = patt_sym s
reflexivity . } Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) s : symbols IHl : bcmcloseex l (patt_sym s) = patt_sym s
bcmcloseex (a :: l) (patt_sym s) = patt_sym s
{ Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) s : symbols IHl : bcmcloseex l (patt_sym s) = patt_sym s
bcmcloseex (a :: l) (patt_sym s) = patt_sym s
simpl .Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) s : symbols IHl : bcmcloseex l (patt_sym s) = patt_sym s
bcmcloseex l (patt_sym s)^{evar :a.1 ↦a.2 } = patt_sym s
rewrite IHl.Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) s : symbols IHl : bcmcloseex l (patt_sym s) = patt_sym s
patt_sym s = patt_sym s
reflexivity . }
Qed .
Lemma bcmcloseex_imp
(l : list (prod db_index evar ))
(p q : Pattern)
: bcmcloseex l (patt_imp p q) = patt_imp (bcmcloseex l p) (bcmcloseex l q).Σ : Signature l : list (db_index * evar ) p, q : Pattern
bcmcloseex l (patt_imp p q) =
patt_imp (bcmcloseex l p) (bcmcloseex l q)
Proof .Σ : Signature l : list (db_index * evar ) p, q : Pattern
bcmcloseex l (patt_imp p q) =
patt_imp (bcmcloseex l p) (bcmcloseex l q)
move : p q.Σ : Signature l : list (db_index * evar )
∀ p q : Pattern,
bcmcloseex l (patt_imp p q) =
patt_imp (bcmcloseex l p) (bcmcloseex l q)
induction l; intros p q.Σ : Signature p, q : Pattern
bcmcloseex [] (patt_imp p q) =
patt_imp (bcmcloseex [] p) (bcmcloseex [] q)
{ Σ : Signature p, q : Pattern
bcmcloseex [] (patt_imp p q) =
patt_imp (bcmcloseex [] p) (bcmcloseex [] q)
reflexivity . } Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ p q : Pattern,
bcmcloseex l (patt_imp p q) = patt_imp (bcmcloseex l p) (bcmcloseex l q)p, q : Pattern
bcmcloseex (a :: l) (patt_imp p q) =
patt_imp (bcmcloseex (a :: l) p)
(bcmcloseex (a :: l) q)
{ Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ p q : Pattern,
bcmcloseex l (patt_imp p q) = patt_imp (bcmcloseex l p) (bcmcloseex l q)p, q : Pattern
bcmcloseex (a :: l) (patt_imp p q) =
patt_imp (bcmcloseex (a :: l) p)
(bcmcloseex (a :: l) q)
simpl .Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ p q : Pattern,
bcmcloseex l (patt_imp p q) = patt_imp (bcmcloseex l p) (bcmcloseex l q)p, q : Pattern
bcmcloseex l (patt_imp p q)^{evar :a.1 ↦a.2 } =
patt_imp (bcmcloseex l p^{evar :a.1 ↦a.2 })
(bcmcloseex l q^{evar :a.1 ↦a.2 })
unfold evar_open.Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ p q : Pattern,
bcmcloseex l (patt_imp p q) = patt_imp (bcmcloseex l p) (bcmcloseex l q)p, q : Pattern
bcmcloseex l
(patt_imp p q)^[evar :a.1 ↦patt_free_evar a.2 ] =
patt_imp
(bcmcloseex l p^[evar :a.1 ↦patt_free_evar a.2 ])
(bcmcloseex l q^[evar :a.1 ↦patt_free_evar a.2 ])
simpl .Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ p q : Pattern,
bcmcloseex l (patt_imp p q) = patt_imp (bcmcloseex l p) (bcmcloseex l q)p, q : Pattern
bcmcloseex l
(patt_imp p^[evar :a.1 ↦patt_free_evar a.2 ]
q^[evar :a.1 ↦patt_free_evar a.2 ]) =
patt_imp
(bcmcloseex l p^[evar :a.1 ↦patt_free_evar a.2 ])
(bcmcloseex l q^[evar :a.1 ↦patt_free_evar a.2 ])
rewrite IHl.Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ p q : Pattern,
bcmcloseex l (patt_imp p q) = patt_imp (bcmcloseex l p) (bcmcloseex l q)p, q : Pattern
patt_imp
(bcmcloseex l p^[evar :a.1 ↦patt_free_evar a.2 ])
(bcmcloseex l q^[evar :a.1 ↦patt_free_evar a.2 ]) =
patt_imp
(bcmcloseex l p^[evar :a.1 ↦patt_free_evar a.2 ])
(bcmcloseex l q^[evar :a.1 ↦patt_free_evar a.2 ])
reflexivity . }
Qed .
Lemma bcmcloseex_app
(l : list (prod db_index evar ))
(p q : Pattern)
: bcmcloseex l (patt_app p q) = patt_app (bcmcloseex l p) (bcmcloseex l q).Σ : Signature l : list (db_index * evar ) p, q : Pattern
bcmcloseex l (patt_app p q) =
patt_app (bcmcloseex l p) (bcmcloseex l q)
Proof .Σ : Signature l : list (db_index * evar ) p, q : Pattern
bcmcloseex l (patt_app p q) =
patt_app (bcmcloseex l p) (bcmcloseex l q)
move : p q.Σ : Signature l : list (db_index * evar )
∀ p q : Pattern,
bcmcloseex l (patt_app p q) =
patt_app (bcmcloseex l p) (bcmcloseex l q)
induction l; intros p q.Σ : Signature p, q : Pattern
bcmcloseex [] (patt_app p q) =
patt_app (bcmcloseex [] p) (bcmcloseex [] q)
{ Σ : Signature p, q : Pattern
bcmcloseex [] (patt_app p q) =
patt_app (bcmcloseex [] p) (bcmcloseex [] q)
reflexivity . } Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ p q : Pattern,
bcmcloseex l (patt_app p q) = patt_app (bcmcloseex l p) (bcmcloseex l q)p, q : Pattern
bcmcloseex (a :: l) (patt_app p q) =
patt_app (bcmcloseex (a :: l) p)
(bcmcloseex (a :: l) q)
{ Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ p q : Pattern,
bcmcloseex l (patt_app p q) = patt_app (bcmcloseex l p) (bcmcloseex l q)p, q : Pattern
bcmcloseex (a :: l) (patt_app p q) =
patt_app (bcmcloseex (a :: l) p)
(bcmcloseex (a :: l) q)
simpl .Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ p q : Pattern,
bcmcloseex l (patt_app p q) = patt_app (bcmcloseex l p) (bcmcloseex l q)p, q : Pattern
bcmcloseex l (patt_app p q)^{evar :a.1 ↦a.2 } =
patt_app (bcmcloseex l p^{evar :a.1 ↦a.2 })
(bcmcloseex l q^{evar :a.1 ↦a.2 })
unfold evar_open.Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ p q : Pattern,
bcmcloseex l (patt_app p q) = patt_app (bcmcloseex l p) (bcmcloseex l q)p, q : Pattern
bcmcloseex l
(patt_app p q)^[evar :a.1 ↦patt_free_evar a.2 ] =
patt_app
(bcmcloseex l p^[evar :a.1 ↦patt_free_evar a.2 ])
(bcmcloseex l q^[evar :a.1 ↦patt_free_evar a.2 ])
simpl .Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ p q : Pattern,
bcmcloseex l (patt_app p q) = patt_app (bcmcloseex l p) (bcmcloseex l q)p, q : Pattern
bcmcloseex l
(patt_app p^[evar :a.1 ↦patt_free_evar a.2 ]
q^[evar :a.1 ↦patt_free_evar a.2 ]) =
patt_app
(bcmcloseex l p^[evar :a.1 ↦patt_free_evar a.2 ])
(bcmcloseex l q^[evar :a.1 ↦patt_free_evar a.2 ])
rewrite IHl.Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ p q : Pattern,
bcmcloseex l (patt_app p q) = patt_app (bcmcloseex l p) (bcmcloseex l q)p, q : Pattern
patt_app
(bcmcloseex l p^[evar :a.1 ↦patt_free_evar a.2 ])
(bcmcloseex l q^[evar :a.1 ↦patt_free_evar a.2 ]) =
patt_app
(bcmcloseex l p^[evar :a.1 ↦patt_free_evar a.2 ])
(bcmcloseex l q^[evar :a.1 ↦patt_free_evar a.2 ])
reflexivity . }
Qed .
Lemma bcmcloseex_ex
(l : list (prod db_index evar ))
(q : Pattern)
: bcmcloseex l (patt_exists q) = patt_exists (bcmcloseex (map (λ p , (S p.1 ,p.2 )) l) q).Σ : Signature l : list (db_index * evar ) q : Pattern
bcmcloseex l (patt_exists q) =
patt_exists
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l)
q)
Proof .Σ : Signature l : list (db_index * evar ) q : Pattern
bcmcloseex l (patt_exists q) =
patt_exists
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l)
q)
move : q.Σ : Signature l : list (db_index * evar )
∀ q : Pattern,
bcmcloseex l (patt_exists q) =
patt_exists
(bcmcloseex
(map (λ p : nat * evar , (S p.1 , p.2 )) l) q)
induction l; intros q.Σ : Signature q : Pattern
bcmcloseex [] (patt_exists q) =
patt_exists
(bcmcloseex
(map (λ p : nat * evar , (S p.1 , p.2 )) []) q)
{ Σ : Signature q : Pattern
bcmcloseex [] (patt_exists q) =
patt_exists
(bcmcloseex
(map (λ p : nat * evar , (S p.1 , p.2 )) []) q)
reflexivity . } Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ q : Pattern,
bcmcloseex l (patt_exists q) =
patt_exists (bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l) q)q : Pattern
bcmcloseex (a :: l) (patt_exists q) =
patt_exists
(bcmcloseex
(map (λ p : nat * evar , (S p.1 , p.2 )) (a :: l)) q)
{ Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ q : Pattern,
bcmcloseex l (patt_exists q) =
patt_exists (bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l) q)q : Pattern
bcmcloseex (a :: l) (patt_exists q) =
patt_exists
(bcmcloseex
(map (λ p : nat * evar , (S p.1 , p.2 )) (a :: l)) q)
simpl .Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ q : Pattern,
bcmcloseex l (patt_exists q) =
patt_exists (bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l) q)q : Pattern
bcmcloseex l (patt_exists q)^{evar :a.1 ↦a.2 } =
patt_exists
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l)
q^{evar :S a.1 ↦a.2 })
rewrite IHl.Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ q : Pattern,
bcmcloseex l (patt_exists q) =
patt_exists (bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l) q)q : Pattern
patt_exists
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l)
((fix bevar_subst
(psi : Pattern) (x : db_index)
(phi : Pattern) {struct phi} : Pattern :=
match phi with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar n =>
match compare_nat n x with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end
| patt_bound_svar n => patt_bound_svar n
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 =>
patt_app (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 =>
patt_imp (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_exists phi' =>
patt_exists (bevar_subst psi (S x) phi')
| patt_mu phi' =>
patt_mu (bevar_subst psi x phi')
end ) (patt_free_evar a.2 ) (S a.1 ) q)) =
patt_exists
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l)
q^{evar :S a.1 ↦a.2 })
reflexivity . }
Qed .
Lemma bcmcloseex_mu
(l : list (prod db_index evar ))
(q : Pattern)
: bcmcloseex l (patt_mu q) = patt_mu (bcmcloseex l q).Σ : Signature l : list (db_index * evar ) q : Pattern
bcmcloseex l (patt_mu q) = patt_mu (bcmcloseex l q)
Proof .Σ : Signature l : list (db_index * evar ) q : Pattern
bcmcloseex l (patt_mu q) = patt_mu (bcmcloseex l q)
move : q.Σ : Signature l : list (db_index * evar )
∀ q : Pattern,
bcmcloseex l (patt_mu q) = patt_mu (bcmcloseex l q)
induction l; intros q.Σ : Signature q : Pattern
bcmcloseex [] (patt_mu q) = patt_mu (bcmcloseex [] q)
{ Σ : Signature q : Pattern
bcmcloseex [] (patt_mu q) = patt_mu (bcmcloseex [] q)
reflexivity . } Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ q : Pattern, bcmcloseex l (patt_mu q) = patt_mu (bcmcloseex l q)q : Pattern
bcmcloseex (a :: l) (patt_mu q) =
patt_mu (bcmcloseex (a :: l) q)
{ Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ q : Pattern, bcmcloseex l (patt_mu q) = patt_mu (bcmcloseex l q)q : Pattern
bcmcloseex (a :: l) (patt_mu q) =
patt_mu (bcmcloseex (a :: l) q)
simpl .Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ q : Pattern, bcmcloseex l (patt_mu q) = patt_mu (bcmcloseex l q)q : Pattern
bcmcloseex l (patt_mu q)^{evar :a.1 ↦a.2 } =
patt_mu (bcmcloseex l q^{evar :a.1 ↦a.2 })
rewrite IHl.Σ : Signature a : (db_index * evar )%type l : list (db_index * evar ) IHl : ∀ q : Pattern, bcmcloseex l (patt_mu q) = patt_mu (bcmcloseex l q)q : Pattern
patt_mu
(bcmcloseex l
((fix bevar_subst
(psi : Pattern) (x : db_index)
(phi : Pattern) {struct phi} : Pattern :=
match phi with
| patt_free_evar x' => patt_free_evar x'
| patt_free_svar x' => patt_free_svar x'
| patt_bound_evar n =>
match compare_nat n x with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => psi
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end
| patt_bound_svar n => patt_bound_svar n
| patt_sym sigma => patt_sym sigma
| patt_app phi1 phi2 =>
patt_app (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_bott => patt_bott
| patt_imp phi1 phi2 =>
patt_imp (bevar_subst psi x phi1)
(bevar_subst psi x phi2)
| patt_exists phi' =>
patt_exists (bevar_subst psi (S x) phi')
| patt_mu phi' =>
patt_mu (bevar_subst psi x phi')
end ) (patt_free_evar a.2 ) a.1 q)) =
patt_mu (bcmcloseex l q^{evar :a.1 ↦a.2 })
reflexivity . }
Qed .
Lemma wfc_ex_aux_S_bevar_subst_fe k ϕ x :
well_formed_closed_ex_aux ϕ^[evar :k↦patt_free_evar x] k = true ->
well_formed_closed_ex_aux ϕ (S k) = true.Σ : Signature k : db_index ϕ : Pattern x : evar
well_formed_closed_ex_aux ϕ^[evar :k↦patt_free_evar x]
k = true → well_formed_closed_ex_aux ϕ (S k) = true
Proof .Σ : Signature k : db_index ϕ : Pattern x : evar
well_formed_closed_ex_aux ϕ^[evar :k↦patt_free_evar x]
k = true → well_formed_closed_ex_aux ϕ (S k) = true
intros H.Σ : Signature k : db_index ϕ : Pattern x : evar H : well_formed_closed_ex_aux
ϕ^[evar :k↦patt_free_evar x] k = true
well_formed_closed_ex_aux ϕ (S k) = true
move : k H.Σ : Signature ϕ : Pattern x : evar
∀ k : db_index,
well_formed_closed_ex_aux
ϕ^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ (S k) = true
induction ϕ; intros k H; simpl in *; auto with nocore.Σ : Signature n : db_index x : evar k : db_index H : well_formed_closed_ex_aux
match compare_nat n k with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end k = true
(if decide (n < S k) then true else false) = true
{ Σ : Signature n : db_index x : evar k : db_index H : well_formed_closed_ex_aux
match compare_nat n k with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end k = true
(if decide (n < S k) then true else false) = true
repeat case_match; auto ; try lia .Σ : Signature n : db_index x : evar k : db_index g : n > k H0 : compare_nat n k = Nat_greater n k g H : well_formed_closed_ex_aux
(patt_bound_evar (Nat.pred n)) k = true n0 : ¬ n < S k H1 : decide (n < S k) = right n0
false = true
simpl in H.Σ : Signature n : db_index x : evar k : db_index g : n > k H0 : compare_nat n k = Nat_greater n k g H : (if decide (Nat.pred n < k) then true else false) =
true n0 : ¬ n < S k H1 : decide (n < S k) = right n0
false = true
case_match; lia . } Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ1 (S k) = trueIHϕ2 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ2 (S k) = truek : db_index H : well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k &&
well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
well_formed_closed_ex_aux ϕ1 (S k) &&
well_formed_closed_ex_aux ϕ2 (S k) = true
{ Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ1 (S k) = trueIHϕ2 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ2 (S k) = truek : db_index H : well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k &&
well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
well_formed_closed_ex_aux ϕ1 (S k) &&
well_formed_closed_ex_aux ϕ2 (S k) = true
destruct_and!. Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ1 (S k) = trueIHϕ2 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ2 (S k) = truek : db_index H0 : well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k = true H1 : well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
well_formed_closed_ex_aux ϕ1 (S k) &&
well_formed_closed_ex_aux ϕ2 (S k) = true
rewrite IHϕ1;[assumption |].Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ1 (S k) = trueIHϕ2 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ2 (S k) = truek : db_index H0 : well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k = true H1 : well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
true && well_formed_closed_ex_aux ϕ2 (S k) = true
rewrite IHϕ2;[assumption |].Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ1 (S k) = trueIHϕ2 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ2 (S k) = truek : db_index H0 : well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k = true H1 : well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
true && true = true
reflexivity . } Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ1 (S k) = trueIHϕ2 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ2 (S k) = truek : db_index H : well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k &&
well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
well_formed_closed_ex_aux ϕ1 (S k) &&
well_formed_closed_ex_aux ϕ2 (S k) = true
{ Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ1 (S k) = trueIHϕ2 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ2 (S k) = truek : db_index H : well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k &&
well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
well_formed_closed_ex_aux ϕ1 (S k) &&
well_formed_closed_ex_aux ϕ2 (S k) = true
destruct_and!. Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ1 (S k) = trueIHϕ2 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ2 (S k) = truek : db_index H0 : well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k = true H1 : well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
well_formed_closed_ex_aux ϕ1 (S k) &&
well_formed_closed_ex_aux ϕ2 (S k) = true
rewrite IHϕ1;[assumption |].Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ1 (S k) = trueIHϕ2 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ2 (S k) = truek : db_index H0 : well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k = true H1 : well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
true && well_formed_closed_ex_aux ϕ2 (S k) = true
rewrite IHϕ2;[assumption |].Σ : Signature ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ1 (S k) = trueIHϕ2 : ∀ k : db_index,
well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
→ well_formed_closed_ex_aux ϕ2 (S k) = truek : db_index H0 : well_formed_closed_ex_aux
ϕ1^[evar :k↦patt_free_evar x] k = true H1 : well_formed_closed_ex_aux
ϕ2^[evar :k↦patt_free_evar x] k = true
true && true = true
reflexivity . }
Qed .
Lemma wfc_ex_aux_evar_open_gt dbi x k ϕ :
k > dbi ->
well_formed_closed_ex_aux (ϕ^{evar : dbi ↦ x}) k ->
well_formed_closed_ex_aux ϕ (S k).Σ : Signature dbi : nat x : evar k : nat ϕ : Pattern
k > dbi
→ well_formed_closed_ex_aux ϕ^{evar :dbi↦x} k
→ well_formed_closed_ex_aux ϕ (S k)
Proof .Σ : Signature dbi : nat x : evar k : nat ϕ : Pattern
k > dbi
→ well_formed_closed_ex_aux ϕ^{evar :dbi↦x} k
→ well_formed_closed_ex_aux ϕ (S k)
unfold evar_open.Σ : Signature dbi : nat x : evar k : nat ϕ : Pattern
k > dbi
→ well_formed_closed_ex_aux
ϕ^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ (S k)
intros H1 H2.Σ : Signature dbi : nat x : evar k : nat ϕ : Pattern H1 : k > dbi H2 : well_formed_closed_ex_aux
ϕ^[evar :dbi↦patt_free_evar x] k
well_formed_closed_ex_aux ϕ (S k)
move : k dbi H1 H2.Σ : Signature x : evar ϕ : Pattern
∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ (S k)
induction ϕ; intros k dbi H1 H2; simpl in *; auto .Σ : Signature x : evar n : db_index k, dbi : nat H1 : k > dbi H2 : well_formed_closed_ex_aux
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end k
if decide (n < S k) then true else false
{ Σ : Signature x : evar n : db_index k, dbi : nat H1 : k > dbi H2 : well_formed_closed_ex_aux
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end k
if decide (n < S k) then true else false
repeat case_match; simpl ; repeat case_match; auto ; try lia .Σ : Signature x : evar n : db_index k, dbi : nat H1 : k > dbi g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H2 : well_formed_closed_ex_aux
(patt_bound_evar (Nat.pred n)) k n0 : ¬ n < S k H0 : decide (n < S k) = right n0
false
simpl in H2.Σ : Signature x : evar n : db_index k, dbi : nat H1 : k > dbi g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H2 : if decide (Nat.pred n < k) then true else falsen0 : ¬ n < S k H0 : decide (n < S k) = right n0
false
case_match; try lia . Σ : Signature x : evar n : db_index k, dbi : nat H1 : k > dbi g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g n1 : ¬ Nat.pred n < k H3 : decide (Nat.pred n < k) = right n1 H2 : false n0 : ¬ n < S k H0 : decide (n < S k) = right n0
false
apply H2.
} Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ1 (S k)IHϕ2 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ2 (S k)k, dbi : nat H1 : k > dbi H2 : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k &&
well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k
well_formed_closed_ex_aux ϕ1 (S k) &&
well_formed_closed_ex_aux ϕ2 (S k)
{ Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ1 (S k)IHϕ2 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ2 (S k)k, dbi : nat H1 : k > dbi H2 : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k &&
well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k
well_formed_closed_ex_aux ϕ1 (S k) &&
well_formed_closed_ex_aux ϕ2 (S k)
destruct_and!. Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ1 (S k)IHϕ2 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ2 (S k)k, dbi : nat H1 : k > dbi H : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k = true H0 : well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k = true
well_formed_closed_ex_aux ϕ1 (S k) &&
well_formed_closed_ex_aux ϕ2 (S k)
rewrite (IHϕ1 k dbi);[assumption |assumption |].Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ1 (S k)IHϕ2 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ2 (S k)k, dbi : nat H1 : k > dbi H : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k = true H0 : well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k = true
true && well_formed_closed_ex_aux ϕ2 (S k)
rewrite (IHϕ2 k dbi);[assumption |assumption |].Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ1 (S k)IHϕ2 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ2 (S k)k, dbi : nat H1 : k > dbi H : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k = true H0 : well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k = true
true && true
reflexivity .
} Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ1 (S k)IHϕ2 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ2 (S k)k, dbi : nat H1 : k > dbi H2 : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k &&
well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k
well_formed_closed_ex_aux ϕ1 (S k) &&
well_formed_closed_ex_aux ϕ2 (S k)
{ Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ1 (S k)IHϕ2 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ2 (S k)k, dbi : nat H1 : k > dbi H2 : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k &&
well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k
well_formed_closed_ex_aux ϕ1 (S k) &&
well_formed_closed_ex_aux ϕ2 (S k)
destruct_and!. Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ1 (S k)IHϕ2 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ2 (S k)k, dbi : nat H1 : k > dbi H : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k = true H0 : well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k = true
well_formed_closed_ex_aux ϕ1 (S k) &&
well_formed_closed_ex_aux ϕ2 (S k)
rewrite (IHϕ1 k dbi);[assumption |assumption |].Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ1 (S k)IHϕ2 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ2 (S k)k, dbi : nat H1 : k > dbi H : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k = true H0 : well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k = true
true && well_formed_closed_ex_aux ϕ2 (S k)
rewrite (IHϕ2 k dbi);[assumption |assumption |].Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ1 (S k)IHϕ2 : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ2 (S k)k, dbi : nat H1 : k > dbi H : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k = true H0 : well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k = true
true && true
reflexivity .
} Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux ϕ^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ (S k)k, dbi : nat H1 : k > dbi H2 : well_formed_closed_ex_aux
ϕ^[evar :S dbi↦patt_free_evar x] (S k)
well_formed_closed_ex_aux ϕ (S (S k))
{ Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux ϕ^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ (S k)k, dbi : nat H1 : k > dbi H2 : well_formed_closed_ex_aux
ϕ^[evar :S dbi↦patt_free_evar x] (S k)
well_formed_closed_ex_aux ϕ (S (S k))
rewrite (IHϕ (S k) (S dbi));[lia |assumption |].Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux ϕ^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ (S k)k, dbi : nat H1 : k > dbi H2 : well_formed_closed_ex_aux
ϕ^[evar :S dbi↦patt_free_evar x] (S k)
true
reflexivity .
} Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux ϕ^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ (S k)k, dbi : nat H1 : k > dbi H2 : well_formed_closed_ex_aux
ϕ^[evar :dbi↦patt_free_evar x] k
well_formed_closed_ex_aux ϕ (S k)
{ Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux ϕ^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ (S k)k, dbi : nat H1 : k > dbi H2 : well_formed_closed_ex_aux
ϕ^[evar :dbi↦patt_free_evar x] k
well_formed_closed_ex_aux ϕ (S k)
eapply IHϕ;[|eassumption ].Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ k dbi : nat,
k > dbi
→ well_formed_closed_ex_aux ϕ^[evar :dbi↦patt_free_evar x] k
→ well_formed_closed_ex_aux ϕ (S k)k, dbi : nat H1 : k > dbi H2 : well_formed_closed_ex_aux
ϕ^[evar :dbi↦patt_free_evar x] k
k > dbi
lia .
}
Qed .
Lemma wfc_ex_aux_evar_open_lt dbi x k ϕ :
k < dbi ->
well_formed_closed_ex_aux (ϕ^{evar : dbi ↦ x}) k = true ->
well_formed_closed_ex_aux ϕ (S dbi) = true.Σ : Signature dbi : nat x : evar k : nat ϕ : Pattern
k < dbi
→ well_formed_closed_ex_aux ϕ^{evar :dbi↦x} k = true
→ well_formed_closed_ex_aux ϕ (S dbi) = true
Proof .Σ : Signature dbi : nat x : evar k : nat ϕ : Pattern
k < dbi
→ well_formed_closed_ex_aux ϕ^{evar :dbi↦x} k = true
→ well_formed_closed_ex_aux ϕ (S dbi) = true
intros H1 H2.Σ : Signature dbi : nat x : evar k : nat ϕ : Pattern H1 : k < dbi H2 : well_formed_closed_ex_aux ϕ^{evar :dbi↦x} k = true
well_formed_closed_ex_aux ϕ (S dbi) = true
move : k dbi H1 H2.Σ : Signature x : evar ϕ : Pattern
∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ^{evar :dbi↦x} k = true
→ well_formed_closed_ex_aux ϕ (S dbi) = true
induction ϕ; intros k dbi H1 H2; simpl in *; auto .Σ : Signature x : evar n : db_index k, dbi : nat H1 : k < dbi H2 : well_formed_closed_ex_aux
(patt_bound_evar n)^{evar :dbi↦x} k = true
(if decide (n < S dbi) then true else false) = true
{ Σ : Signature x : evar n : db_index k, dbi : nat H1 : k < dbi H2 : well_formed_closed_ex_aux
(patt_bound_evar n)^{evar :dbi↦x} k = true
(if decide (n < S dbi) then true else false) = true
unfold evar_open in H2.Σ : Signature x : evar n : db_index k, dbi : nat H1 : k < dbi H2 : well_formed_closed_ex_aux
(patt_bound_evar n)^[evar :dbi↦patt_free_evar x]
k = true
(if decide (n < S dbi) then true else false) = true
simpl in H2.Σ : Signature x : evar n : db_index k, dbi : nat H1 : k < dbi H2 : well_formed_closed_ex_aux
match compare_nat n dbi with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ =>
patt_bound_evar (Nat.pred n)
end k = true
(if decide (n < S dbi) then true else false) = true
repeat case_match; auto ; try lia .Σ : Signature x : evar n : db_index k, dbi : nat H1 : k < dbi g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H2 : well_formed_closed_ex_aux
(patt_bound_evar (Nat.pred n)) k = true n0 : ¬ n < S dbi H0 : decide (n < S dbi) = right n0
false = true
simpl in H2.Σ : Signature x : evar n : db_index k, dbi : nat H1 : k < dbi g : n > dbi H : compare_nat n dbi = Nat_greater n dbi g H2 : (if decide (Nat.pred n < k) then true else false) =
true n0 : ¬ n < S dbi H0 : decide (n < S dbi) = right n0
false = true
case_match; lia .
} Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ1^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ1 (S dbi) =
trueIHϕ2 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ2^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ2 (S dbi) =
truek, dbi : nat H1 : k < dbi H2 : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k &&
well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k = true
well_formed_closed_ex_aux ϕ1 (S dbi) &&
well_formed_closed_ex_aux ϕ2 (S dbi) = true
{ Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ1^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ1 (S dbi) =
trueIHϕ2 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ2^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ2 (S dbi) =
truek, dbi : nat H1 : k < dbi H2 : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k &&
well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k = true
well_formed_closed_ex_aux ϕ1 (S dbi) &&
well_formed_closed_ex_aux ϕ2 (S dbi) = true
destruct_and!. Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ1^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ1 (S dbi) =
trueIHϕ2 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ2^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ2 (S dbi) =
truek, dbi : nat H1 : k < dbi H : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k = true H0 : well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k = true
well_formed_closed_ex_aux ϕ1 (S dbi) &&
well_formed_closed_ex_aux ϕ2 (S dbi) = true
rewrite (IHϕ1 k dbi);[assumption |assumption |].Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ1^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ1 (S dbi) =
trueIHϕ2 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ2^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ2 (S dbi) =
truek, dbi : nat H1 : k < dbi H : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k = true H0 : well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k = true
true && well_formed_closed_ex_aux ϕ2 (S dbi) = true
rewrite (IHϕ2 k dbi);[assumption |assumption |].Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ1^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ1 (S dbi) =
trueIHϕ2 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ2^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ2 (S dbi) =
truek, dbi : nat H1 : k < dbi H : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k = true H0 : well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k = true
true && true = true
reflexivity .
} Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ1^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ1 (S dbi) =
trueIHϕ2 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ2^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ2 (S dbi) =
truek, dbi : nat H1 : k < dbi H2 : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k &&
well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k = true
well_formed_closed_ex_aux ϕ1 (S dbi) &&
well_formed_closed_ex_aux ϕ2 (S dbi) = true
{ Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ1^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ1 (S dbi) =
trueIHϕ2 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ2^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ2 (S dbi) =
truek, dbi : nat H1 : k < dbi H2 : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k &&
well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k = true
well_formed_closed_ex_aux ϕ1 (S dbi) &&
well_formed_closed_ex_aux ϕ2 (S dbi) = true
destruct_and!. Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ1^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ1 (S dbi) =
trueIHϕ2 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ2^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ2 (S dbi) =
truek, dbi : nat H1 : k < dbi H : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k = true H0 : well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k = true
well_formed_closed_ex_aux ϕ1 (S dbi) &&
well_formed_closed_ex_aux ϕ2 (S dbi) = true
rewrite (IHϕ1 k dbi);[assumption |assumption |].Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ1^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ1 (S dbi) =
trueIHϕ2 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ2^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ2 (S dbi) =
truek, dbi : nat H1 : k < dbi H : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k = true H0 : well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k = true
true && well_formed_closed_ex_aux ϕ2 (S dbi) = true
rewrite (IHϕ2 k dbi);[assumption |assumption |].Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ1^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ1 (S dbi) =
trueIHϕ2 : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ2^{evar :dbi↦x} k =
true
→ well_formed_closed_ex_aux ϕ2 (S dbi) =
truek, dbi : nat H1 : k < dbi H : well_formed_closed_ex_aux
ϕ1^[evar :dbi↦patt_free_evar x] k = true H0 : well_formed_closed_ex_aux
ϕ2^[evar :dbi↦patt_free_evar x] k = true
true && true = true
reflexivity .
} Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ^{evar :dbi↦x} k = true
→ well_formed_closed_ex_aux ϕ (S dbi) = truek, dbi : nat H1 : k < dbi H2 : well_formed_closed_ex_aux
ϕ^[evar :S dbi↦patt_free_evar x] (S k) = true
well_formed_closed_ex_aux ϕ (S (S dbi)) = true
{ Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ^{evar :dbi↦x} k = true
→ well_formed_closed_ex_aux ϕ (S dbi) = truek, dbi : nat H1 : k < dbi H2 : well_formed_closed_ex_aux
ϕ^[evar :S dbi↦patt_free_evar x] (S k) = true
well_formed_closed_ex_aux ϕ (S (S dbi)) = true
rewrite (IHϕ (S k) (S dbi));[lia |assumption |].Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ^{evar :dbi↦x} k = true
→ well_formed_closed_ex_aux ϕ (S dbi) = truek, dbi : nat H1 : k < dbi H2 : well_formed_closed_ex_aux
ϕ^[evar :S dbi↦patt_free_evar x] (S k) = true
true = true
reflexivity .
} Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ^{evar :dbi↦x} k = true
→ well_formed_closed_ex_aux ϕ (S dbi) = truek, dbi : nat H1 : k < dbi H2 : well_formed_closed_ex_aux
ϕ^[evar :dbi↦patt_free_evar x] k = true
well_formed_closed_ex_aux ϕ (S dbi) = true
{ Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ^{evar :dbi↦x} k = true
→ well_formed_closed_ex_aux ϕ (S dbi) = truek, dbi : nat H1 : k < dbi H2 : well_formed_closed_ex_aux
ϕ^[evar :dbi↦patt_free_evar x] k = true
well_formed_closed_ex_aux ϕ (S dbi) = true
eapply IHϕ;[|eassumption ].Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ k dbi : nat,
k < dbi
→ well_formed_closed_ex_aux ϕ^{evar :dbi↦x} k = true
→ well_formed_closed_ex_aux ϕ (S dbi) = truek, dbi : nat H1 : k < dbi H2 : well_formed_closed_ex_aux
ϕ^[evar :dbi↦patt_free_evar x] k = true
k < dbi
lia .
}
Qed .
Lemma evar_open_twice_not_occur n x y ϕ :
bevar_occur ϕ n = false ->
ϕ^{evar : n ↦ x}^{evar : n ↦ y} = ϕ^{evar : S n ↦ y}^{evar : n ↦ x}.Σ : Signature n : db_index x, y : evar ϕ : Pattern
bevar_occur ϕ n = false
→ ϕ^{evar :n↦x}^{evar :n↦y} = ϕ^{evar :S n↦y}^{evar :n↦x}
Proof .Σ : Signature n : db_index x, y : evar ϕ : Pattern
bevar_occur ϕ n = false
→ ϕ^{evar :n↦x}^{evar :n↦y} = ϕ^{evar :S n↦y}^{evar :n↦x}
unfold evar_open.Σ : Signature n : db_index x, y : evar ϕ : Pattern
bevar_occur ϕ n = false
→ ϕ^[evar :n↦patt_free_evar x]^[evar :n↦patt_free_evar y] =
ϕ^[evar :S n↦patt_free_evar y]^[evar :n↦patt_free_evar
x]
move : n.Σ : Signature x, y : evar ϕ : Pattern
∀ n : db_index,
bevar_occur ϕ n = false
→ ϕ^[evar :n↦patt_free_evar x]^[evar :n↦patt_free_evar
y] =
ϕ^[evar :S n↦patt_free_evar y]^[evar :n↦patt_free_evar
x]
induction ϕ; intros n' Hnoc; simpl in *; auto .Σ : Signature x, y : evar n, n' : db_index Hnoc : (if decide (n = n') then true else false) =
false
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end ^[evar :n'↦patt_free_evar y] =
match compare_nat n (S n') with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar y
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end ^[evar :n'↦patt_free_evar x]
{ Σ : Signature x, y : evar n, n' : db_index Hnoc : (if decide (n = n') then true else false) =
false
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end ^[evar :n'↦patt_free_evar y] =
match compare_nat n (S n') with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => patt_free_evar y
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end ^[evar :n'↦patt_free_evar x]
repeat case_match; simpl ; auto ; try lia ; repeat case_match; auto ; try congruence ; lia .
} Σ : Signature x, y : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
bevar_occur ϕ1 n = false
→ ϕ1^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ1^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
bevar_occur ϕ2 n = false
→ ϕ2^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ2^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]n' : db_index Hnoc : bevar_occur ϕ1 n' || bevar_occur ϕ2 n' = false
patt_app
ϕ1^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y]
ϕ2^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y] =
patt_app
ϕ1^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
ϕ2^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
{ Σ : Signature x, y : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
bevar_occur ϕ1 n = false
→ ϕ1^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ1^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
bevar_occur ϕ2 n = false
→ ϕ2^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ2^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]n' : db_index Hnoc : bevar_occur ϕ1 n' || bevar_occur ϕ2 n' = false
patt_app
ϕ1^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y]
ϕ2^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y] =
patt_app
ϕ1^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
ϕ2^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
apply orb_false_elim in Hnoc.Σ : Signature x, y : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
bevar_occur ϕ1 n = false
→ ϕ1^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ1^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
bevar_occur ϕ2 n = false
→ ϕ2^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ2^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]n' : db_index Hnoc : bevar_occur ϕ1 n' = false
∧ bevar_occur ϕ2 n' = false
patt_app
ϕ1^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y]
ϕ2^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y] =
patt_app
ϕ1^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
ϕ2^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
destruct_and!. Σ : Signature x, y : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
bevar_occur ϕ1 n = false
→ ϕ1^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ1^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
bevar_occur ϕ2 n = false
→ ϕ2^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ2^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]n' : db_index H : bevar_occur ϕ1 n' = false H0 : bevar_occur ϕ2 n' = false
patt_app
ϕ1^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y]
ϕ2^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y] =
patt_app
ϕ1^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
ϕ2^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
rewrite (IHϕ1 n'); [assumption |].Σ : Signature x, y : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
bevar_occur ϕ1 n = false
→ ϕ1^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ1^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
bevar_occur ϕ2 n = false
→ ϕ2^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ2^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]n' : db_index H : bevar_occur ϕ1 n' = false H0 : bevar_occur ϕ2 n' = false
patt_app
ϕ1^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
ϕ2^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y] =
patt_app
ϕ1^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
ϕ2^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
rewrite (IHϕ2 n'); [assumption |].Σ : Signature x, y : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
bevar_occur ϕ1 n = false
→ ϕ1^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ1^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
bevar_occur ϕ2 n = false
→ ϕ2^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ2^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]n' : db_index H : bevar_occur ϕ1 n' = false H0 : bevar_occur ϕ2 n' = false
patt_app
ϕ1^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
ϕ2^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x] =
patt_app
ϕ1^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
ϕ2^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
reflexivity .
} Σ : Signature x, y : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
bevar_occur ϕ1 n = false
→ ϕ1^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ1^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
bevar_occur ϕ2 n = false
→ ϕ2^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ2^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]n' : db_index Hnoc : bevar_occur ϕ1 n' || bevar_occur ϕ2 n' = false
patt_imp
ϕ1^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y]
ϕ2^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y] =
patt_imp
ϕ1^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
ϕ2^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
{ Σ : Signature x, y : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
bevar_occur ϕ1 n = false
→ ϕ1^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ1^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
bevar_occur ϕ2 n = false
→ ϕ2^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ2^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]n' : db_index Hnoc : bevar_occur ϕ1 n' || bevar_occur ϕ2 n' = false
patt_imp
ϕ1^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y]
ϕ2^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y] =
patt_imp
ϕ1^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
ϕ2^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
apply orb_false_elim in Hnoc.Σ : Signature x, y : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
bevar_occur ϕ1 n = false
→ ϕ1^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ1^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
bevar_occur ϕ2 n = false
→ ϕ2^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ2^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]n' : db_index Hnoc : bevar_occur ϕ1 n' = false
∧ bevar_occur ϕ2 n' = false
patt_imp
ϕ1^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y]
ϕ2^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y] =
patt_imp
ϕ1^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
ϕ2^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
destruct_and!. Σ : Signature x, y : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
bevar_occur ϕ1 n = false
→ ϕ1^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ1^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
bevar_occur ϕ2 n = false
→ ϕ2^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ2^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]n' : db_index H : bevar_occur ϕ1 n' = false H0 : bevar_occur ϕ2 n' = false
patt_imp
ϕ1^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y]
ϕ2^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y] =
patt_imp
ϕ1^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
ϕ2^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
rewrite (IHϕ1 n'); [assumption |].Σ : Signature x, y : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
bevar_occur ϕ1 n = false
→ ϕ1^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ1^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
bevar_occur ϕ2 n = false
→ ϕ2^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ2^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]n' : db_index H : bevar_occur ϕ1 n' = false H0 : bevar_occur ϕ2 n' = false
patt_imp
ϕ1^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
ϕ2^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y] =
patt_imp
ϕ1^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
ϕ2^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
rewrite (IHϕ2 n'); [assumption |].Σ : Signature x, y : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
bevar_occur ϕ1 n = false
→ ϕ1^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ1^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
bevar_occur ϕ2 n = false
→ ϕ2^[evar :n↦patt_free_evar x]^[evar :n↦
patt_free_evar y] =
ϕ2^[evar :S n↦patt_free_evar y]^[evar :n↦
patt_free_evar x]n' : db_index H : bevar_occur ϕ1 n' = false H0 : bevar_occur ϕ2 n' = false
patt_imp
ϕ1^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
ϕ2^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x] =
patt_imp
ϕ1^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
ϕ2^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
reflexivity .
} Σ : Signature x, y : evar ϕ : Pattern IHϕ : ∀ n : db_index,
bevar_occur ϕ n = false
→ ϕ^[evar :n↦patt_free_evar x]^[evar :n↦patt_free_evar y] =
ϕ^[evar :S n↦patt_free_evar y]^[evar :n↦patt_free_evar x]n' : db_index Hnoc : bevar_occur ϕ (S n') = false
patt_exists
ϕ^[evar :S n'↦patt_free_evar x]^[evar :S n'↦patt_free_evar
y] =
patt_exists
ϕ^[evar :S (S n')↦patt_free_evar y]^[evar :S n'↦patt_free_evar
x]
{ Σ : Signature x, y : evar ϕ : Pattern IHϕ : ∀ n : db_index,
bevar_occur ϕ n = false
→ ϕ^[evar :n↦patt_free_evar x]^[evar :n↦patt_free_evar y] =
ϕ^[evar :S n↦patt_free_evar y]^[evar :n↦patt_free_evar x]n' : db_index Hnoc : bevar_occur ϕ (S n') = false
patt_exists
ϕ^[evar :S n'↦patt_free_evar x]^[evar :S n'↦patt_free_evar
y] =
patt_exists
ϕ^[evar :S (S n')↦patt_free_evar y]^[evar :S n'↦patt_free_evar
x]
rewrite (IHϕ (S n'));[assumption |].Σ : Signature x, y : evar ϕ : Pattern IHϕ : ∀ n : db_index,
bevar_occur ϕ n = false
→ ϕ^[evar :n↦patt_free_evar x]^[evar :n↦patt_free_evar y] =
ϕ^[evar :S n↦patt_free_evar y]^[evar :n↦patt_free_evar x]n' : db_index Hnoc : bevar_occur ϕ (S n') = false
patt_exists
ϕ^[evar :S (S n')↦patt_free_evar y]^[evar :S n'↦patt_free_evar
x] =
patt_exists
ϕ^[evar :S (S n')↦patt_free_evar y]^[evar :S n'↦patt_free_evar
x]
reflexivity .
} Σ : Signature x, y : evar ϕ : Pattern IHϕ : ∀ n : db_index,
bevar_occur ϕ n = false
→ ϕ^[evar :n↦patt_free_evar x]^[evar :n↦patt_free_evar y] =
ϕ^[evar :S n↦patt_free_evar y]^[evar :n↦patt_free_evar x]n' : db_index Hnoc : bevar_occur ϕ n' = false
patt_mu
ϕ^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y] =
patt_mu
ϕ^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
{ Σ : Signature x, y : evar ϕ : Pattern IHϕ : ∀ n : db_index,
bevar_occur ϕ n = false
→ ϕ^[evar :n↦patt_free_evar x]^[evar :n↦patt_free_evar y] =
ϕ^[evar :S n↦patt_free_evar y]^[evar :n↦patt_free_evar x]n' : db_index Hnoc : bevar_occur ϕ n' = false
patt_mu
ϕ^[evar :n'↦patt_free_evar x]^[evar :n'↦patt_free_evar
y] =
patt_mu
ϕ^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
rewrite IHϕ;[assumption |].Σ : Signature x, y : evar ϕ : Pattern IHϕ : ∀ n : db_index,
bevar_occur ϕ n = false
→ ϕ^[evar :n↦patt_free_evar x]^[evar :n↦patt_free_evar y] =
ϕ^[evar :S n↦patt_free_evar y]^[evar :n↦patt_free_evar x]n' : db_index Hnoc : bevar_occur ϕ n' = false
patt_mu
ϕ^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x] =
patt_mu
ϕ^[evar :S n'↦patt_free_evar y]^[evar :n'↦patt_free_evar
x]
reflexivity .
}
Qed .
Lemma wfc_ex_aux_bcmcloseex l k ϕ :
Forall (λ p : nat * evar , p.1 ≤ k) l ->
well_formed_closed_ex_aux (bcmcloseex l (patt_exists ϕ)) k = true ->
well_formed_closed_ex_aux (bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l) ϕ) (S k) = true.Σ : Signature l : list (nat * evar ) k : nat ϕ : Pattern
Forall (λ p : nat * evar , p.1 ≤ k) l
→ well_formed_closed_ex_aux
(bcmcloseex l (patt_exists ϕ)) k = true
→ well_formed_closed_ex_aux
(bcmcloseex
(map (λ p : nat * evar , (S p.1 , p.2 )) l) ϕ)
(S k) = true
Proof .Σ : Signature l : list (nat * evar ) k : nat ϕ : Pattern
Forall (λ p : nat * evar , p.1 ≤ k) l
→ well_formed_closed_ex_aux
(bcmcloseex l (patt_exists ϕ)) k = true
→ well_formed_closed_ex_aux
(bcmcloseex
(map (λ p : nat * evar , (S p.1 , p.2 )) l) ϕ)
(S k) = true
intros Hk H.Σ : Signature l : list (nat * evar ) k : nat ϕ : Pattern Hk : Forall (λ p : nat * evar , p.1 ≤ k) l H : well_formed_closed_ex_aux
(bcmcloseex l (patt_exists ϕ)) k = true
well_formed_closed_ex_aux
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l)
ϕ) (S k) = true
move : ϕ k Hk H.Σ : Signature l : list (nat * evar )
∀ (ϕ : Pattern) (k : nat),
Forall (λ p : nat * evar , p.1 ≤ k) l
→ well_formed_closed_ex_aux
(bcmcloseex l (patt_exists ϕ)) k = true
→ well_formed_closed_ex_aux
(bcmcloseex
(map (λ p : nat * evar , (S p.1 , p.2 )) l) ϕ)
(S k) = true
induction l; intros ϕ k Hk H.Σ : Signature ϕ : Pattern k : nat Hk : Forall (λ p : nat * evar , p.1 ≤ k) [] H : well_formed_closed_ex_aux
(bcmcloseex [] (patt_exists ϕ)) k = true
well_formed_closed_ex_aux
(bcmcloseex
(map (λ p : nat * evar , (S p.1 , p.2 )) []) ϕ)
(S k) = true
{ Σ : Signature ϕ : Pattern k : nat Hk : Forall (λ p : nat * evar , p.1 ≤ k) [] H : well_formed_closed_ex_aux
(bcmcloseex [] (patt_exists ϕ)) k = true
well_formed_closed_ex_aux
(bcmcloseex
(map (λ p : nat * evar , (S p.1 , p.2 )) []) ϕ)
(S k) = true
simpl .Σ : Signature ϕ : Pattern k : nat Hk : Forall (λ p : nat * evar , p.1 ≤ k) [] H : well_formed_closed_ex_aux
(bcmcloseex [] (patt_exists ϕ)) k = true
well_formed_closed_ex_aux ϕ (S k) = true
simpl in H.Σ : Signature ϕ : Pattern k : nat Hk : Forall (λ p : nat * evar , p.1 ≤ k) [] H : well_formed_closed_ex_aux ϕ (S k) = true
well_formed_closed_ex_aux ϕ (S k) = true
apply H. } Σ : Signature a : (nat * evar )%type l : list (nat * evar ) IHl : ∀ (ϕ : Pattern) (k : nat),
Forall (λ p : nat * evar , p.1 ≤ k) l
→ well_formed_closed_ex_aux (bcmcloseex l (patt_exists ϕ)) k = true
→ well_formed_closed_ex_aux
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l) ϕ) (S k) = trueϕ : Pattern k : nat Hk : Forall (λ p : nat * evar , p.1 ≤ k) (a :: l) H : well_formed_closed_ex_aux
(bcmcloseex (a :: l) (patt_exists ϕ)) k = true
well_formed_closed_ex_aux
(bcmcloseex
(map (λ p : nat * evar , (S p.1 , p.2 )) (a :: l)) ϕ)
(S k) = true
{ Σ : Signature a : (nat * evar )%type l : list (nat * evar ) IHl : ∀ (ϕ : Pattern) (k : nat),
Forall (λ p : nat * evar , p.1 ≤ k) l
→ well_formed_closed_ex_aux (bcmcloseex l (patt_exists ϕ)) k = true
→ well_formed_closed_ex_aux
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l) ϕ) (S k) = trueϕ : Pattern k : nat Hk : Forall (λ p : nat * evar , p.1 ≤ k) (a :: l) H : well_formed_closed_ex_aux
(bcmcloseex (a :: l) (patt_exists ϕ)) k = true
well_formed_closed_ex_aux
(bcmcloseex
(map (λ p : nat * evar , (S p.1 , p.2 )) (a :: l)) ϕ)
(S k) = true
destruct a as [dbi x].Σ : Signature dbi : nat x : evar l : list (nat * evar ) IHl : ∀ (ϕ : Pattern) (k : nat),
Forall (λ p : nat * evar , p.1 ≤ k) l
→ well_formed_closed_ex_aux (bcmcloseex l (patt_exists ϕ)) k = true
→ well_formed_closed_ex_aux
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l) ϕ) (S k) = trueϕ : Pattern k : nat Hk : Forall (λ p : nat * evar , p.1 ≤ k)
((dbi, x) :: l) H : well_formed_closed_ex_aux
(bcmcloseex ((dbi, x) :: l) (patt_exists ϕ)) k =
true
well_formed_closed_ex_aux
(bcmcloseex
(map (λ p : nat * evar , (S p.1 , p.2 ))
((dbi, x) :: l)) ϕ) (S k) = true
simpl .Σ : Signature dbi : nat x : evar l : list (nat * evar ) IHl : ∀ (ϕ : Pattern) (k : nat),
Forall (λ p : nat * evar , p.1 ≤ k) l
→ well_formed_closed_ex_aux (bcmcloseex l (patt_exists ϕ)) k = true
→ well_formed_closed_ex_aux
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l) ϕ) (S k) = trueϕ : Pattern k : nat Hk : Forall (λ p : nat * evar , p.1 ≤ k)
((dbi, x) :: l) H : well_formed_closed_ex_aux
(bcmcloseex ((dbi, x) :: l) (patt_exists ϕ)) k =
true
well_formed_closed_ex_aux
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l)
ϕ^{evar :S dbi↦x}) (S k) = true
simpl in H.Σ : Signature dbi : nat x : evar l : list (nat * evar ) IHl : ∀ (ϕ : Pattern) (k : nat),
Forall (λ p : nat * evar , p.1 ≤ k) l
→ well_formed_closed_ex_aux (bcmcloseex l (patt_exists ϕ)) k = true
→ well_formed_closed_ex_aux
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l) ϕ) (S k) = trueϕ : Pattern k : nat Hk : Forall (λ p : nat * evar , p.1 ≤ k)
((dbi, x) :: l) H : well_formed_closed_ex_aux
(bcmcloseex l (patt_exists ϕ)^{evar :dbi↦x}) k =
true
well_formed_closed_ex_aux
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l)
ϕ^{evar :S dbi↦x}) (S k) = true
apply IHl.Σ : Signature dbi : nat x : evar l : list (nat * evar ) IHl : ∀ (ϕ : Pattern) (k : nat),
Forall (λ p : nat * evar , p.1 ≤ k) l
→ well_formed_closed_ex_aux (bcmcloseex l (patt_exists ϕ)) k = true
→ well_formed_closed_ex_aux
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l) ϕ) (S k) = trueϕ : Pattern k : nat Hk : Forall (λ p : nat * evar , p.1 ≤ k)
((dbi, x) :: l) H : well_formed_closed_ex_aux
(bcmcloseex l (patt_exists ϕ)^{evar :dbi↦x}) k =
true
Forall (λ p : nat * evar , p.1 ≤ k) l
{ Σ : Signature dbi : nat x : evar l : list (nat * evar ) IHl : ∀ (ϕ : Pattern) (k : nat),
Forall (λ p : nat * evar , p.1 ≤ k) l
→ well_formed_closed_ex_aux (bcmcloseex l (patt_exists ϕ)) k = true
→ well_formed_closed_ex_aux
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l) ϕ) (S k) = trueϕ : Pattern k : nat Hk : Forall (λ p : nat * evar , p.1 ≤ k)
((dbi, x) :: l) H : well_formed_closed_ex_aux
(bcmcloseex l (patt_exists ϕ)^{evar :dbi↦x}) k =
true
Forall (λ p : nat * evar , p.1 ≤ k) l
inversion Hk.Σ : Signature dbi : nat x : evar l : list (nat * evar ) IHl : ∀ (ϕ : Pattern) (k : nat),
Forall (λ p : nat * evar , p.1 ≤ k) l
→ well_formed_closed_ex_aux (bcmcloseex l (patt_exists ϕ)) k = true
→ well_formed_closed_ex_aux
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l) ϕ) (S k) = trueϕ : Pattern k : nat Hk : Forall (λ p : nat * evar , p.1 ≤ k)
((dbi, x) :: l) H : well_formed_closed_ex_aux
(bcmcloseex l (patt_exists ϕ)^{evar :dbi↦x}) k =
true x0 : (nat * evar )%type l0 : list (nat * evar ) H2 : (dbi, x).1 ≤ k H3 : Forall (λ p : nat * evar , p.1 ≤ k) l H0 : x0 = (dbi, x) H1 : l0 = l
Forall (λ p : nat * evar , p.1 ≤ k) l
subst .Σ : Signature dbi : nat x : evar l : list (nat * evar ) IHl : ∀ (ϕ : Pattern) (k : nat),
Forall (λ p : nat * evar , p.1 ≤ k) l
→ well_formed_closed_ex_aux (bcmcloseex l (patt_exists ϕ)) k = true
→ well_formed_closed_ex_aux
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l) ϕ) (S k) = trueϕ : Pattern k : nat Hk : Forall (λ p : nat * evar , p.1 ≤ k)
((dbi, x) :: l) H : well_formed_closed_ex_aux
(bcmcloseex l (patt_exists ϕ)^{evar :dbi↦x}) k =
true H2 : (dbi, x).1 ≤ k H3 : Forall (λ p : nat * evar , p.1 ≤ k) l
Forall (λ p : nat * evar , p.1 ≤ k) l
assumption . } Σ : Signature dbi : nat x : evar l : list (nat * evar ) IHl : ∀ (ϕ : Pattern) (k : nat),
Forall (λ p : nat * evar , p.1 ≤ k) l
→ well_formed_closed_ex_aux (bcmcloseex l (patt_exists ϕ)) k = true
→ well_formed_closed_ex_aux
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l) ϕ) (S k) = trueϕ : Pattern k : nat Hk : Forall (λ p : nat * evar , p.1 ≤ k)
((dbi, x) :: l) H : well_formed_closed_ex_aux
(bcmcloseex l (patt_exists ϕ)^{evar :dbi↦x}) k =
true
well_formed_closed_ex_aux
(bcmcloseex l (patt_exists ϕ^{evar :S dbi↦x})) k =
true
{ Σ : Signature dbi : nat x : evar l : list (nat * evar ) IHl : ∀ (ϕ : Pattern) (k : nat),
Forall (λ p : nat * evar , p.1 ≤ k) l
→ well_formed_closed_ex_aux (bcmcloseex l (patt_exists ϕ)) k = true
→ well_formed_closed_ex_aux
(bcmcloseex (map (λ p : nat * evar , (S p.1 , p.2 )) l) ϕ) (S k) = trueϕ : Pattern k : nat Hk : Forall (λ p : nat * evar , p.1 ≤ k)
((dbi, x) :: l) H : well_formed_closed_ex_aux
(bcmcloseex l (patt_exists ϕ)^{evar :dbi↦x}) k =
true
well_formed_closed_ex_aux
(bcmcloseex l (patt_exists ϕ^{evar :S dbi↦x})) k =
true
apply H. }
}
Qed .
Lemma free_svars_free_evar_subst ϕ x ψ :
free_svars (ϕ^[[evar : x ↦ ψ]]) ⊆ free_svars ϕ ∪ free_svars ψ.Σ : Signature ϕ : Pattern x : evar ψ : Pattern
free_svars ϕ^[[evar :x↦ψ]]
⊆ free_svars ϕ ∪ free_svars ψ
Proof .Σ : Signature ϕ : Pattern x : evar ψ : Pattern
free_svars ϕ^[[evar :x↦ψ]]
⊆ free_svars ϕ ∪ free_svars ψ
induction ϕ; simpl ; try set_solver.Σ : Signature x0, x : evar ψ : Pattern
free_svars
(if decide (x = x0) then ψ else patt_free_evar x0)
⊆ ∅ ∪ free_svars ψ
{ Σ : Signature x0, x : evar ψ : Pattern
free_svars
(if decide (x = x0) then ψ else patt_free_evar x0)
⊆ ∅ ∪ free_svars ψ
case_match. Σ : Signature x0, x : evar ψ : Pattern e : x = x0 H : decide (x = x0) = left e
free_svars ψ ⊆ ∅ ∪ free_svars ψ
{ Σ : Signature x0, x : evar ψ : Pattern e : x = x0 H : decide (x = x0) = left e
free_svars ψ ⊆ ∅ ∪ free_svars ψ
subst .Σ : Signature x0 : evar ψ : Pattern H : decide (x0 = x0) = left (erefl x0)
free_svars ψ ⊆ ∅ ∪ free_svars ψ
set_solver.
} Σ : Signature x0, x : evar ψ : Pattern n : x ≠ x0 H : decide (x = x0) = right n
free_svars (patt_free_evar x0) ⊆ ∅ ∪ free_svars ψ
{ Σ : Signature x0, x : evar ψ : Pattern n : x ≠ x0 H : decide (x = x0) = right n
free_svars (patt_free_evar x0) ⊆ ∅ ∪ free_svars ψ
simpl .Σ : Signature x0, x : evar ψ : Pattern n : x ≠ x0 H : decide (x = x0) = right n
∅ ⊆ ∅ ∪ free_svars ψ
set_solver.
}
}
Qed .
Lemma no_neg_occ_quan_impl_no_neg_occ x n1 n2 ϕ :
no_negative_occurrence_db_b n1 (ϕ^{{evar : x ↦ n2}}) = true ->
no_negative_occurrence_db_b n1 ϕ = true
with no_pos_occ_quan_impl_no_pos_occ x n1 n2 ϕ:
no_positive_occurrence_db_b n1 (ϕ^{{evar : x ↦ n2}}) = true ->
no_positive_occurrence_db_b n1 ϕ = true.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar n1, n2 : db_index ϕ : Pattern
no_negative_occurrence_db_b n1 ϕ^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ = true
Proof .Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar n1, n2 : db_index ϕ : Pattern
no_negative_occurrence_db_b n1 ϕ^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ = true
- Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar n1, n2 : db_index ϕ : Pattern
no_negative_occurrence_db_b n1 ϕ^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ = true
intros H.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar n1, n2 : db_index ϕ : Pattern H : no_negative_occurrence_db_b n1 ϕ^{{evar :x↦n2}} =
true
no_negative_occurrence_db_b n1 ϕ = true
move : n1 n2 H.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern
∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1 ϕ^{{evar :x↦n2}} =
true → no_negative_occurrence_db_b n1 ϕ = true
induction ϕ; intros n1 n2 H; simpl in *; auto .Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H : no_negative_occurrence_db_b n1
(patt_app ϕ1^{{evar :x↦n2}} ϕ2^{{evar :x↦n2}}) =
true
no_negative_occurrence_db_b n1 (patt_app ϕ1 ϕ2) = true
+ Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H : no_negative_occurrence_db_b n1
(patt_app ϕ1^{{evar :x↦n2}} ϕ2^{{evar :x↦n2}}) =
true
no_negative_occurrence_db_b n1 (patt_app ϕ1 ϕ2) = true
unfold no_negative_occurrence_db_b in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
(fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
n1
ϕ^{{evar :x↦n2}} =
true
→ (fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1
ϕ1^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1
ϕ2^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ2 = truen1, n2 : db_index H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ1^{{evar :x↦n2}} &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ2^{{evar :x↦n2}} =
true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ1 &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ2 = true
simpl in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
(fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
n1
ϕ^{{evar :x↦n2}} =
true
→ (fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1
ϕ1^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1
ϕ2^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ2 = truen1, n2 : db_index H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ1^{{evar :x↦n2}} &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ2^{{evar :x↦n2}} =
true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ1 &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ2 = true
fold no_negative_occurrence_db_b in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H : no_negative_occurrence_db_b n1 ϕ1^{{evar :x↦n2}} &&
no_negative_occurrence_db_b n1 ϕ2^{{evar :x↦n2}} =
true
no_negative_occurrence_db_b n1 ϕ1 &&
no_negative_occurrence_db_b n1 ϕ2 = true
destruct_and!. Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H0 : no_negative_occurrence_db_b n1 ϕ1^{{evar :x↦n2}} =
true H1 : no_negative_occurrence_db_b n1 ϕ2^{{evar :x↦n2}} =
true
no_negative_occurrence_db_b n1 ϕ1 &&
no_negative_occurrence_db_b n1 ϕ2 = true
erewrite -> IHϕ1 by eassumption .Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H0 : no_negative_occurrence_db_b n1 ϕ1^{{evar :x↦n2}} =
true H1 : no_negative_occurrence_db_b n1 ϕ2^{{evar :x↦n2}} =
true
true && no_negative_occurrence_db_b n1 ϕ2 = true
erewrite -> IHϕ2 by eassumption .Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H0 : no_negative_occurrence_db_b n1 ϕ1^{{evar :x↦n2}} =
true H1 : no_negative_occurrence_db_b n1 ϕ2^{{evar :x↦n2}} =
true
true && true = true
reflexivity .
+ Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H : no_negative_occurrence_db_b n1
(patt_imp ϕ1^{{evar :x↦n2}} ϕ2^{{evar :x↦n2}}) =
true
no_negative_occurrence_db_b n1 (patt_imp ϕ1 ϕ2) = true
unfold no_negative_occurrence_db_b in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
(fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
n1
ϕ^{{evar :x↦n2}} =
true
→ (fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1
ϕ1^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1
ϕ2^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ2 = truen1, n2 : db_index H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ1^{{evar :x↦n2}} &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ2^{{evar :x↦n2}} =
true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ1 &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ2 = true
simpl in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
(fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
n1
ϕ^{{evar :x↦n2}} =
true
→ (fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1
ϕ1^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1
ϕ2^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ2 = truen1, n2 : db_index H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ1^{{evar :x↦n2}} &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ2^{{evar :x↦n2}} =
true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ1 &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ2 = true
fold no_negative_occurrence_db_b no_positive_occurrence_db_b in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H : no_positive_occurrence_db_b n1 ϕ1^{{evar :x↦n2}} &&
no_negative_occurrence_db_b n1 ϕ2^{{evar :x↦n2}} =
true
no_positive_occurrence_db_b n1 ϕ1 &&
no_negative_occurrence_db_b n1 ϕ2 = true
destruct_and!. Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H0 : no_positive_occurrence_db_b n1 ϕ1^{{evar :x↦n2}} =
true H1 : no_negative_occurrence_db_b n1 ϕ2^{{evar :x↦n2}} =
true
no_positive_occurrence_db_b n1 ϕ1 &&
no_negative_occurrence_db_b n1 ϕ2 = true
erewrite -> no_pos_occ_quan_impl_no_pos_occ by eassumption .Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H0 : no_positive_occurrence_db_b n1 ϕ1^{{evar :x↦n2}} =
true H1 : no_negative_occurrence_db_b n1 ϕ2^{{evar :x↦n2}} =
true
true && no_negative_occurrence_db_b n1 ϕ2 = true
erewrite -> IHϕ2 by eassumption .Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_negative_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H0 : no_positive_occurrence_db_b n1 ϕ1^{{evar :x↦n2}} =
true H1 : no_negative_occurrence_db_b n1 ϕ2^{{evar :x↦n2}} =
true
true && true = true
reflexivity .
+ Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1 ϕ^{{evar :x↦n2}} =
true → no_negative_occurrence_db_b n1 ϕ = truen1, n2 : db_index H : no_negative_occurrence_db_b n1
(patt_exists ϕ^{{evar :x↦S n2}}) = true
no_negative_occurrence_db_b n1 (patt_exists ϕ) = true
unfold no_negative_occurrence_db_b in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
(fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
n1
ϕ^{{evar :x↦n2}} =
true
→ (fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1
ϕ^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ = truen1, n2 : db_index H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ^{{evar :x↦
S n2}} = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ = true
simpl in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
(fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
n1
ϕ^{{evar :x↦n2}} =
true
→ (fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1
ϕ^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ = truen1, n2 : db_index H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ^{{evar :x↦
S n2}} = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ = true
fold no_negative_occurrence_db_b in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1 ϕ^{{evar :x↦n2}} =
true → no_negative_occurrence_db_b n1 ϕ = truen1, n2 : db_index H : no_negative_occurrence_db_b n1 ϕ^{{evar :x↦S n2}} =
true
no_negative_occurrence_db_b n1 ϕ = true
erewrite -> IHϕ by eassumption .Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1 ϕ^{{evar :x↦n2}} =
true → no_negative_occurrence_db_b n1 ϕ = truen1, n2 : db_index H : no_negative_occurrence_db_b n1 ϕ^{{evar :x↦S n2}} =
true
true = true
reflexivity .
+ Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1 ϕ^{{evar :x↦n2}} =
true → no_negative_occurrence_db_b n1 ϕ = truen1, n2 : db_index H : no_negative_occurrence_db_b n1
(patt_mu ϕ^{{evar :x↦n2}}) = true
no_negative_occurrence_db_b n1 (patt_mu ϕ) = true
unfold no_negative_occurrence_db_b in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
(fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
n1
ϕ^{{evar :x↦n2}} =
true
→ (fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1
ϕ^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ = truen1, n2 : db_index H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
(S n1) ϕ^{{evar :x↦n2}} = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) (S n1) ϕ = true
simpl in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
(fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
n1
ϕ^{{evar :x↦n2}} =
true
→ (fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1
ϕ^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ = truen1, n2 : db_index H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b)
(S n1) ϕ^{{evar :x↦n2}} = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) (S n1) ϕ = true
fold no_negative_occurrence_db_b in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1 ϕ^{{evar :x↦n2}} =
true → no_negative_occurrence_db_b n1 ϕ = truen1, n2 : db_index H : no_negative_occurrence_db_b (S n1) ϕ^{{evar :x↦n2}} =
true
no_negative_occurrence_db_b (S n1) ϕ = true
erewrite -> IHϕ by eassumption .Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
no_negative_occurrence_db_b n1 ϕ^{{evar :x↦n2}} =
true → no_negative_occurrence_db_b n1 ϕ = truen1, n2 : db_index H : no_negative_occurrence_db_b (S n1) ϕ^{{evar :x↦n2}} =
true
true = true
reflexivity .
- Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar n1, n2 : db_index ϕ : Pattern
no_positive_occurrence_db_b n1 ϕ^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ = true
intros H.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar n1, n2 : db_index ϕ : Pattern H : no_positive_occurrence_db_b n1 ϕ^{{evar :x↦n2}} =
true
no_positive_occurrence_db_b n1 ϕ = true
move : n1 n2 H.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern
∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1 ϕ^{{evar :x↦n2}} =
true → no_positive_occurrence_db_b n1 ϕ = true
induction ϕ; intros n1 n2 H; simpl in *; auto .Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H : no_positive_occurrence_db_b n1
(patt_app ϕ1^{{evar :x↦n2}} ϕ2^{{evar :x↦n2}}) =
true
no_positive_occurrence_db_b n1 (patt_app ϕ1 ϕ2) = true
+ Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H : no_positive_occurrence_db_b n1
(patt_app ϕ1^{{evar :x↦n2}} ϕ2^{{evar :x↦n2}}) =
true
no_positive_occurrence_db_b n1 (patt_app ϕ1 ϕ2) = true
unfold no_positive_occurrence_db_b in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
(fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
n1
ϕ^{{evar :x↦n2}} =
true
→ (fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1
ϕ1^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1
ϕ2^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ2 = truen1, n2 : db_index H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ1^{{evar :x↦n2}} &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ2^{{evar :x↦n2}} =
true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ1 &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ2 = true
simpl in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
(fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
n1
ϕ^{{evar :x↦n2}} =
true
→ (fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1
ϕ1^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1
ϕ2^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ2 = truen1, n2 : db_index H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ1^{{evar :x↦n2}} &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ2^{{evar :x↦n2}} =
true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ1 &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ2 = true
fold no_positive_occurrence_db_b in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H : no_positive_occurrence_db_b n1 ϕ1^{{evar :x↦n2}} &&
no_positive_occurrence_db_b n1 ϕ2^{{evar :x↦n2}} =
true
no_positive_occurrence_db_b n1 ϕ1 &&
no_positive_occurrence_db_b n1 ϕ2 = true
destruct_and!. Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H0 : no_positive_occurrence_db_b n1 ϕ1^{{evar :x↦n2}} =
true H1 : no_positive_occurrence_db_b n1 ϕ2^{{evar :x↦n2}} =
true
no_positive_occurrence_db_b n1 ϕ1 &&
no_positive_occurrence_db_b n1 ϕ2 = true
erewrite -> IHϕ1 by eassumption .Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H0 : no_positive_occurrence_db_b n1 ϕ1^{{evar :x↦n2}} =
true H1 : no_positive_occurrence_db_b n1 ϕ2^{{evar :x↦n2}} =
true
true && no_positive_occurrence_db_b n1 ϕ2 = true
erewrite -> IHϕ2 by eassumption .Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H0 : no_positive_occurrence_db_b n1 ϕ1^{{evar :x↦n2}} =
true H1 : no_positive_occurrence_db_b n1 ϕ2^{{evar :x↦n2}} =
true
true && true = true
reflexivity .
+ Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H : no_positive_occurrence_db_b n1
(patt_imp ϕ1^{{evar :x↦n2}} ϕ2^{{evar :x↦n2}}) =
true
no_positive_occurrence_db_b n1 (patt_imp ϕ1 ϕ2) = true
unfold no_positive_occurrence_db_b in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
(fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
n1
ϕ^{{evar :x↦n2}} =
true
→ (fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1
ϕ1^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1
ϕ2^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ2 = truen1, n2 : db_index H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ1^{{evar :x↦n2}} &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ2^{{evar :x↦n2}} =
true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ1 &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ2 = true
simpl in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
(fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
n1
ϕ^{{evar :x↦n2}} =
true
→ (fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1
ϕ1^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1
ϕ2^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index)
(ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ2 = truen1, n2 : db_index H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ1^{{evar :x↦n2}} &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ2^{{evar :x↦n2}} =
true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n1 ϕ1 &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ2 = true
fold no_positive_occurrence_db_b no_negative_occurrence_db_b in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H : no_negative_occurrence_db_b n1 ϕ1^{{evar :x↦n2}} &&
no_positive_occurrence_db_b n1 ϕ2^{{evar :x↦n2}} =
true
no_negative_occurrence_db_b n1 ϕ1 &&
no_positive_occurrence_db_b n1 ϕ2 = true
destruct_and!. Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H0 : no_negative_occurrence_db_b n1 ϕ1^{{evar :x↦n2}} =
true H1 : no_positive_occurrence_db_b n1 ϕ2^{{evar :x↦n2}} =
true
no_negative_occurrence_db_b n1 ϕ1 &&
no_positive_occurrence_db_b n1 ϕ2 = true
erewrite -> no_neg_occ_quan_impl_no_neg_occ by eassumption .Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H0 : no_negative_occurrence_db_b n1 ϕ1^{{evar :x↦n2}} =
true H1 : no_positive_occurrence_db_b n1 ϕ2^{{evar :x↦n2}} =
true
true && no_positive_occurrence_db_b n1 ϕ2 = true
erewrite -> IHϕ2 by eassumption .Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ1^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ1 = trueIHϕ2 : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1
ϕ2^{{evar :x↦n2}} = true
→ no_positive_occurrence_db_b n1 ϕ2 = truen1, n2 : db_index H0 : no_negative_occurrence_db_b n1 ϕ1^{{evar :x↦n2}} =
true H1 : no_positive_occurrence_db_b n1 ϕ2^{{evar :x↦n2}} =
true
true && true = true
reflexivity .
+ Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1 ϕ^{{evar :x↦n2}} =
true → no_positive_occurrence_db_b n1 ϕ = truen1, n2 : db_index H : no_positive_occurrence_db_b n1
(patt_exists ϕ^{{evar :x↦S n2}}) = true
no_positive_occurrence_db_b n1 (patt_exists ϕ) = true
unfold no_positive_occurrence_db_b in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
(fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
n1
ϕ^{{evar :x↦n2}} =
true
→ (fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1
ϕ^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ = truen1, n2 : db_index H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ^{{evar :x↦
S n2}} = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ = true
simpl in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
(fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
n1
ϕ^{{evar :x↦n2}} =
true
→ (fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1
ϕ^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ = truen1, n2 : db_index H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ^{{evar :x↦
S n2}} = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ = true
fold no_positive_occurrence_db_b in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1 ϕ^{{evar :x↦n2}} =
true → no_positive_occurrence_db_b n1 ϕ = truen1, n2 : db_index H : no_positive_occurrence_db_b n1 ϕ^{{evar :x↦S n2}} =
true
no_positive_occurrence_db_b n1 ϕ = true
erewrite -> IHϕ by eassumption .Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1 ϕ^{{evar :x↦n2}} =
true → no_positive_occurrence_db_b n1 ϕ = truen1, n2 : db_index H : no_positive_occurrence_db_b n1 ϕ^{{evar :x↦S n2}} =
true
true = true
reflexivity .
+ Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1 ϕ^{{evar :x↦n2}} =
true → no_positive_occurrence_db_b n1 ϕ = truen1, n2 : db_index H : no_positive_occurrence_db_b n1
(patt_mu ϕ^{{evar :x↦n2}}) = true
no_positive_occurrence_db_b n1 (patt_mu ϕ) = true
unfold no_positive_occurrence_db_b in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
(fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
n1
ϕ^{{evar :x↦n2}} =
true
→ (fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1
ϕ^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ = truen1, n2 : db_index H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
(S n1) ϕ^{{evar :x↦n2}} = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) (S n1) ϕ = true
simpl in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
(fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
n1
ϕ^{{evar :x↦n2}} =
true
→ (fix
no_negative_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_app ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_negative_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_negative_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
with
no_positive_occurrence_db_b
(dbi : db_index)
(ϕ0 : Pattern)
{struct ϕ0} :
bool :=
match ϕ0 with
| patt_bound_svar
n =>
if
decide
(n = dbi)
then false
else true
| patt_app ϕ₁
ϕ₂ =>
no_positive_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_imp ϕ₁
ϕ₂ =>
no_negative_occurrence_db_b
dbi ϕ₁ &&
no_positive_occurrence_db_b
dbi ϕ₂
| patt_exists
ϕ' =>
no_positive_occurrence_db_b
dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b
(S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1
ϕ^{{evar :x↦n2}} = true
→ (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi)
then false
else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n1 ϕ = truen1, n2 : db_index H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b)
(S n1) ϕ^{{evar :x↦n2}} = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) (S n1) ϕ = true
fold no_positive_occurrence_db_b in *.Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1 ϕ^{{evar :x↦n2}} =
true → no_positive_occurrence_db_b n1 ϕ = truen1, n2 : db_index H : no_positive_occurrence_db_b (S n1) ϕ^{{evar :x↦n2}} =
true
no_positive_occurrence_db_b (S n1) ϕ = true
erewrite -> IHϕ by eassumption .Σ : Signature no_neg_occ_quan_impl_no_neg_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_negative_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_negative_occurrence_db_b
n1 ϕ = trueno_pos_occ_quan_impl_no_pos_occ : ∀ (x : evar )
(n1 n2 : db_index)
(ϕ : Pattern),
no_positive_occurrence_db_b
n1
ϕ^{{evar :x↦n2}} =
true
→ no_positive_occurrence_db_b
n1 ϕ = truex : evar ϕ : Pattern IHϕ : ∀ n1 n2 : db_index,
no_positive_occurrence_db_b n1 ϕ^{{evar :x↦n2}} =
true → no_positive_occurrence_db_b n1 ϕ = truen1, n2 : db_index H : no_positive_occurrence_db_b (S n1) ϕ^{{evar :x↦n2}} =
true
true = true
reflexivity .
Qed .
Lemma wfp_evar_quan_impl_wfp x n ϕ :
well_formed_positive (ϕ^{{evar : x ↦ n}}) = true ->
well_formed_positive ϕ.Σ : Signature x : evar n : db_index ϕ : Pattern
well_formed_positive ϕ^{{evar :x↦n}} = true
→ well_formed_positive ϕ
Proof .Σ : Signature x : evar n : db_index ϕ : Pattern
well_formed_positive ϕ^{{evar :x↦n}} = true
→ well_formed_positive ϕ
intros H.Σ : Signature x : evar n : db_index ϕ : Pattern H : well_formed_positive ϕ^{{evar :x↦n}} = true
well_formed_positive ϕ
move : n H.Σ : Signature x : evar ϕ : Pattern
∀ n : db_index,
well_formed_positive ϕ^{{evar :x↦n}} = true
→ well_formed_positive ϕ
induction ϕ; intros n' H; simpl in *; auto .Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
well_formed_positive ϕ1^{{evar :x↦n}} = true
→ well_formed_positive ϕ1IHϕ2 : ∀ n : db_index,
well_formed_positive ϕ2^{{evar :x↦n}} = true
→ well_formed_positive ϕ2n' : db_index H : well_formed_positive ϕ1^{{evar :x↦n'}} &&
well_formed_positive ϕ2^{{evar :x↦n'}} = true
well_formed_positive ϕ1 && well_formed_positive ϕ2
- Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
well_formed_positive ϕ1^{{evar :x↦n}} = true
→ well_formed_positive ϕ1IHϕ2 : ∀ n : db_index,
well_formed_positive ϕ2^{{evar :x↦n}} = true
→ well_formed_positive ϕ2n' : db_index H : well_formed_positive ϕ1^{{evar :x↦n'}} &&
well_formed_positive ϕ2^{{evar :x↦n'}} = true
well_formed_positive ϕ1 && well_formed_positive ϕ2
destruct_and!. Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
well_formed_positive ϕ1^{{evar :x↦n}} = true
→ well_formed_positive ϕ1IHϕ2 : ∀ n : db_index,
well_formed_positive ϕ2^{{evar :x↦n}} = true
→ well_formed_positive ϕ2n' : db_index H0 : well_formed_positive ϕ1^{{evar :x↦n'}} = true H1 : well_formed_positive ϕ2^{{evar :x↦n'}} = true
well_formed_positive ϕ1 && well_formed_positive ϕ2
erewrite -> IHϕ1 by eassumption .Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
well_formed_positive ϕ1^{{evar :x↦n}} = true
→ well_formed_positive ϕ1IHϕ2 : ∀ n : db_index,
well_formed_positive ϕ2^{{evar :x↦n}} = true
→ well_formed_positive ϕ2n' : db_index H0 : well_formed_positive ϕ1^{{evar :x↦n'}} = true H1 : well_formed_positive ϕ2^{{evar :x↦n'}} = true
true && well_formed_positive ϕ2
erewrite -> IHϕ2 by eassumption .Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
well_formed_positive ϕ1^{{evar :x↦n}} = true
→ well_formed_positive ϕ1IHϕ2 : ∀ n : db_index,
well_formed_positive ϕ2^{{evar :x↦n}} = true
→ well_formed_positive ϕ2n' : db_index H0 : well_formed_positive ϕ1^{{evar :x↦n'}} = true H1 : well_formed_positive ϕ2^{{evar :x↦n'}} = true
true && true
reflexivity .
- Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
well_formed_positive ϕ1^{{evar :x↦n}} = true
→ well_formed_positive ϕ1IHϕ2 : ∀ n : db_index,
well_formed_positive ϕ2^{{evar :x↦n}} = true
→ well_formed_positive ϕ2n' : db_index H : well_formed_positive ϕ1^{{evar :x↦n'}} &&
well_formed_positive ϕ2^{{evar :x↦n'}} = true
well_formed_positive ϕ1 && well_formed_positive ϕ2
destruct_and!. Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
well_formed_positive ϕ1^{{evar :x↦n}} = true
→ well_formed_positive ϕ1IHϕ2 : ∀ n : db_index,
well_formed_positive ϕ2^{{evar :x↦n}} = true
→ well_formed_positive ϕ2n' : db_index H0 : well_formed_positive ϕ1^{{evar :x↦n'}} = true H1 : well_formed_positive ϕ2^{{evar :x↦n'}} = true
well_formed_positive ϕ1 && well_formed_positive ϕ2
erewrite -> IHϕ1 by eassumption .Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
well_formed_positive ϕ1^{{evar :x↦n}} = true
→ well_formed_positive ϕ1IHϕ2 : ∀ n : db_index,
well_formed_positive ϕ2^{{evar :x↦n}} = true
→ well_formed_positive ϕ2n' : db_index H0 : well_formed_positive ϕ1^{{evar :x↦n'}} = true H1 : well_formed_positive ϕ2^{{evar :x↦n'}} = true
true && well_formed_positive ϕ2
erewrite -> IHϕ2 by eassumption .Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n : db_index,
well_formed_positive ϕ1^{{evar :x↦n}} = true
→ well_formed_positive ϕ1IHϕ2 : ∀ n : db_index,
well_formed_positive ϕ2^{{evar :x↦n}} = true
→ well_formed_positive ϕ2n' : db_index H0 : well_formed_positive ϕ1^{{evar :x↦n'}} = true H1 : well_formed_positive ϕ2^{{evar :x↦n'}} = true
true && true
reflexivity .
- Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ n : db_index,
well_formed_positive ϕ^{{evar :x↦n}} = true → well_formed_positive ϕn' : db_index H : well_formed_positive ϕ^{{evar :x↦S n'}} = true
well_formed_positive ϕ
erewrite IHϕ by eassumption .Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ n : db_index,
well_formed_positive ϕ^{{evar :x↦n}} = true → well_formed_positive ϕn' : db_index H : well_formed_positive ϕ^{{evar :x↦S n'}} = true
true
reflexivity .
- Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ n : db_index,
well_formed_positive ϕ^{{evar :x↦n}} = true → well_formed_positive ϕn' : db_index H : no_negative_occurrence_db_b 0 ϕ^{{evar :x↦n'}} &&
well_formed_positive ϕ^{{evar :x↦n'}} = true
no_negative_occurrence_db_b 0 ϕ &&
well_formed_positive ϕ
simpl .Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ n : db_index,
well_formed_positive ϕ^{{evar :x↦n}} = true → well_formed_positive ϕn' : db_index H : no_negative_occurrence_db_b 0 ϕ^{{evar :x↦n'}} &&
well_formed_positive ϕ^{{evar :x↦n'}} = true
no_negative_occurrence_db_b 0 ϕ &&
well_formed_positive ϕ
destruct_and!. Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ n : db_index,
well_formed_positive ϕ^{{evar :x↦n}} = true → well_formed_positive ϕn' : db_index H0 : no_negative_occurrence_db_b 0 ϕ^{{evar :x↦n'}} =
true H1 : well_formed_positive ϕ^{{evar :x↦n'}} = true
no_negative_occurrence_db_b 0 ϕ &&
well_formed_positive ϕ
erewrite -> IHϕ by eassumption .Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ n : db_index,
well_formed_positive ϕ^{{evar :x↦n}} = true → well_formed_positive ϕn' : db_index H0 : no_negative_occurrence_db_b 0 ϕ^{{evar :x↦n'}} =
true H1 : well_formed_positive ϕ^{{evar :x↦n'}} = true
no_negative_occurrence_db_b 0 ϕ && true
erewrite -> no_neg_occ_quan_impl_no_neg_occ by eassumption .Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ n : db_index,
well_formed_positive ϕ^{{evar :x↦n}} = true → well_formed_positive ϕn' : db_index H0 : no_negative_occurrence_db_b 0 ϕ^{{evar :x↦n'}} =
true H1 : well_formed_positive ϕ^{{evar :x↦n'}} = true
true && true
reflexivity .
Qed .
Lemma wfp_evar_quan x n ϕ :
well_formed_positive (ϕ^{{evar : x ↦ n}}) = well_formed_positive ϕ.Σ : Signature x : evar n : db_index ϕ : Pattern
well_formed_positive ϕ^{{evar :x↦n}} =
well_formed_positive ϕ
Proof .Σ : Signature x : evar n : db_index ϕ : Pattern
well_formed_positive ϕ^{{evar :x↦n}} =
well_formed_positive ϕ
destruct (well_formed_positive (ϕ^{{evar : x ↦ n}})) eqn :H1,(well_formed_positive ϕ) eqn :H2;
try reflexivity .Σ : Signature x : evar n : db_index ϕ : Pattern H1 : well_formed_positive ϕ^{{evar :x↦n}} = true H2 : well_formed_positive ϕ = false
true = false
{ Σ : Signature x : evar n : db_index ϕ : Pattern H1 : well_formed_positive ϕ^{{evar :x↦n}} = true H2 : well_formed_positive ϕ = false
true = false
apply wfp_evar_quan_impl_wfp in H1.Σ : Signature x : evar n : db_index ϕ : Pattern H1 : well_formed_positive ϕ H2 : well_formed_positive ϕ = false
true = false
congruence .
} Σ : Signature x : evar n : db_index ϕ : Pattern H1 : well_formed_positive ϕ^{{evar :x↦n}} = false H2 : well_formed_positive ϕ = true
false = true
{ Σ : Signature x : evar n : db_index ϕ : Pattern H1 : well_formed_positive ϕ^{{evar :x↦n}} = false H2 : well_formed_positive ϕ = true
false = true
apply evar_quantify_positive with (x := x) (n := n) in H2.Σ : Signature x : evar n : db_index ϕ : Pattern H1 : well_formed_positive ϕ^{{evar :x↦n}} = false H2 : well_formed_positive ϕ^{{evar :x↦n}} = true
false = true
congruence .
}
Qed .
Lemma wfcmu_evar_quan_impl_wfcmu x n dbi ϕ :
well_formed_closed_mu_aux (ϕ^{{evar : x ↦ n}}) dbi = true ->
well_formed_closed_mu_aux ϕ dbi.Σ : Signature x : evar n, dbi : db_index ϕ : Pattern
well_formed_closed_mu_aux ϕ^{{evar :x↦n}} dbi = true
→ well_formed_closed_mu_aux ϕ dbi
Proof .Σ : Signature x : evar n, dbi : db_index ϕ : Pattern
well_formed_closed_mu_aux ϕ^{{evar :x↦n}} dbi = true
→ well_formed_closed_mu_aux ϕ dbi
intros H.Σ : Signature x : evar n, dbi : db_index ϕ : Pattern H : well_formed_closed_mu_aux ϕ^{{evar :x↦n}} dbi =
true
well_formed_closed_mu_aux ϕ dbi
move : n dbi H.Σ : Signature x : evar ϕ : Pattern
∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ^{{evar :x↦n}} dbi = true
→ well_formed_closed_mu_aux ϕ dbi
induction ϕ; intros n' dbi H; simpl in *; auto .Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ2 dbin', dbi : db_index H : well_formed_closed_mu_aux ϕ1^{{evar :x↦n'}} dbi &&
well_formed_closed_mu_aux ϕ2^{{evar :x↦n'}} dbi =
true
well_formed_closed_mu_aux ϕ1 dbi &&
well_formed_closed_mu_aux ϕ2 dbi
- Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ2 dbin', dbi : db_index H : well_formed_closed_mu_aux ϕ1^{{evar :x↦n'}} dbi &&
well_formed_closed_mu_aux ϕ2^{{evar :x↦n'}} dbi =
true
well_formed_closed_mu_aux ϕ1 dbi &&
well_formed_closed_mu_aux ϕ2 dbi
destruct_and!. Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ2 dbin', dbi : db_index H0 : well_formed_closed_mu_aux ϕ1^{{evar :x↦n'}} dbi =
true H1 : well_formed_closed_mu_aux ϕ2^{{evar :x↦n'}} dbi =
true
well_formed_closed_mu_aux ϕ1 dbi &&
well_formed_closed_mu_aux ϕ2 dbi
erewrite -> IHϕ1 by eassumption .Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ2 dbin', dbi : db_index H0 : well_formed_closed_mu_aux ϕ1^{{evar :x↦n'}} dbi =
true H1 : well_formed_closed_mu_aux ϕ2^{{evar :x↦n'}} dbi =
true
true && well_formed_closed_mu_aux ϕ2 dbi
erewrite -> IHϕ2 by eassumption .Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ2 dbin', dbi : db_index H0 : well_formed_closed_mu_aux ϕ1^{{evar :x↦n'}} dbi =
true H1 : well_formed_closed_mu_aux ϕ2^{{evar :x↦n'}} dbi =
true
true && true
reflexivity .
- Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ2 dbin', dbi : db_index H : well_formed_closed_mu_aux ϕ1^{{evar :x↦n'}} dbi &&
well_formed_closed_mu_aux ϕ2^{{evar :x↦n'}} dbi =
true
well_formed_closed_mu_aux ϕ1 dbi &&
well_formed_closed_mu_aux ϕ2 dbi
destruct_and!. Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ2 dbin', dbi : db_index H0 : well_formed_closed_mu_aux ϕ1^{{evar :x↦n'}} dbi =
true H1 : well_formed_closed_mu_aux ϕ2^{{evar :x↦n'}} dbi =
true
well_formed_closed_mu_aux ϕ1 dbi &&
well_formed_closed_mu_aux ϕ2 dbi
erewrite -> IHϕ1 by eassumption .Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ2 dbin', dbi : db_index H0 : well_formed_closed_mu_aux ϕ1^{{evar :x↦n'}} dbi =
true H1 : well_formed_closed_mu_aux ϕ2^{{evar :x↦n'}} dbi =
true
true && well_formed_closed_mu_aux ϕ2 dbi
erewrite -> IHϕ2 by eassumption .Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_mu_aux ϕ2 dbin', dbi : db_index H0 : well_formed_closed_mu_aux ϕ1^{{evar :x↦n'}} dbi =
true H1 : well_formed_closed_mu_aux ϕ2^{{evar :x↦n'}} dbi =
true
true && true
reflexivity .
- Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ^{{evar :x↦n}} dbi = true
→ well_formed_closed_mu_aux ϕ dbin', dbi : db_index H : well_formed_closed_mu_aux ϕ^{{evar :x↦S n'}} dbi =
true
well_formed_closed_mu_aux ϕ dbi
erewrite IHϕ by eassumption .Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ^{{evar :x↦n}} dbi = true
→ well_formed_closed_mu_aux ϕ dbin', dbi : db_index H : well_formed_closed_mu_aux ϕ^{{evar :x↦S n'}} dbi =
true
true
reflexivity .
- Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ^{{evar :x↦n}} dbi = true
→ well_formed_closed_mu_aux ϕ dbin', dbi : db_index H : well_formed_closed_mu_aux ϕ^{{evar :x↦n'}} (S dbi) =
true
well_formed_closed_mu_aux ϕ (S dbi)
simpl .Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ^{{evar :x↦n}} dbi = true
→ well_formed_closed_mu_aux ϕ dbin', dbi : db_index H : well_formed_closed_mu_aux ϕ^{{evar :x↦n'}} (S dbi) =
true
well_formed_closed_mu_aux ϕ (S dbi)
erewrite -> IHϕ by eassumption .Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ n dbi : db_index,
well_formed_closed_mu_aux ϕ^{{evar :x↦n}} dbi = true
→ well_formed_closed_mu_aux ϕ dbin', dbi : db_index H : well_formed_closed_mu_aux ϕ^{{evar :x↦n'}} (S dbi) =
true
true
reflexivity .
Qed .
Lemma wfcmu_evar_quan x n dbi ϕ :
well_formed_closed_mu_aux (ϕ^{{evar : x ↦ n}}) dbi
= well_formed_closed_mu_aux ϕ dbi.Σ : Signature x : evar n, dbi : db_index ϕ : Pattern
well_formed_closed_mu_aux ϕ^{{evar :x↦n}} dbi =
well_formed_closed_mu_aux ϕ dbi
Proof .Σ : Signature x : evar n, dbi : db_index ϕ : Pattern
well_formed_closed_mu_aux ϕ^{{evar :x↦n}} dbi =
well_formed_closed_mu_aux ϕ dbi
destruct (well_formed_closed_mu_aux (ϕ^{{evar : x ↦ n}}) dbi) eqn :H1,
(well_formed_closed_mu_aux ϕ dbi) eqn :H2;
try reflexivity .Σ : Signature x : evar n, dbi : db_index ϕ : Pattern H1 : well_formed_closed_mu_aux ϕ^{{evar :x↦n}} dbi =
true H2 : well_formed_closed_mu_aux ϕ dbi = false
true = false
{ Σ : Signature x : evar n, dbi : db_index ϕ : Pattern H1 : well_formed_closed_mu_aux ϕ^{{evar :x↦n}} dbi =
true H2 : well_formed_closed_mu_aux ϕ dbi = false
true = false
apply wfcmu_evar_quan_impl_wfcmu in H1.Σ : Signature x : evar n, dbi : db_index ϕ : Pattern H1 : well_formed_closed_mu_aux ϕ dbi H2 : well_formed_closed_mu_aux ϕ dbi = false
true = false
congruence .
} Σ : Signature x : evar n, dbi : db_index ϕ : Pattern H1 : well_formed_closed_mu_aux ϕ^{{evar :x↦n}} dbi =
false H2 : well_formed_closed_mu_aux ϕ dbi = true
false = true
{ Σ : Signature x : evar n, dbi : db_index ϕ : Pattern H1 : well_formed_closed_mu_aux ϕ^{{evar :x↦n}} dbi =
false H2 : well_formed_closed_mu_aux ϕ dbi = true
false = true
apply evar_quantify_closed_mu with (x := x) (n := n) in H2.Σ : Signature x : evar n, dbi : db_index ϕ : Pattern H1 : well_formed_closed_mu_aux ϕ^{{evar :x↦n}} dbi =
false H2 : well_formed_closed_mu_aux ϕ^{{evar :x↦n}} dbi =
true
false = true
congruence .
}
Qed .
Lemma wfcex_evar_quan_impl_wfcex x n dbi ϕ :
well_formed_closed_ex_aux (ϕ^{{evar : x ↦ n}}) dbi = true ->
well_formed_closed_ex_aux ϕ dbi.Σ : Signature x : evar n, dbi : db_index ϕ : Pattern
well_formed_closed_ex_aux ϕ^{{evar :x↦n}} dbi = true
→ well_formed_closed_ex_aux ϕ dbi
Proof .Σ : Signature x : evar n, dbi : db_index ϕ : Pattern
well_formed_closed_ex_aux ϕ^{{evar :x↦n}} dbi = true
→ well_formed_closed_ex_aux ϕ dbi
intros H.Σ : Signature x : evar n, dbi : db_index ϕ : Pattern H : well_formed_closed_ex_aux ϕ^{{evar :x↦n}} dbi =
true
well_formed_closed_ex_aux ϕ dbi
move : n dbi H.Σ : Signature x : evar ϕ : Pattern
∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ^{{evar :x↦n}} dbi = true
→ well_formed_closed_ex_aux ϕ dbi
induction ϕ; intros n' dbi H; simpl in *; auto .Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ2 dbin', dbi : db_index H : well_formed_closed_ex_aux ϕ1^{{evar :x↦n'}} dbi &&
well_formed_closed_ex_aux ϕ2^{{evar :x↦n'}} dbi =
true
well_formed_closed_ex_aux ϕ1 dbi &&
well_formed_closed_ex_aux ϕ2 dbi
- Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ2 dbin', dbi : db_index H : well_formed_closed_ex_aux ϕ1^{{evar :x↦n'}} dbi &&
well_formed_closed_ex_aux ϕ2^{{evar :x↦n'}} dbi =
true
well_formed_closed_ex_aux ϕ1 dbi &&
well_formed_closed_ex_aux ϕ2 dbi
destruct_and!. Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ2 dbin', dbi : db_index H0 : well_formed_closed_ex_aux ϕ1^{{evar :x↦n'}} dbi =
true H1 : well_formed_closed_ex_aux ϕ2^{{evar :x↦n'}} dbi =
true
well_formed_closed_ex_aux ϕ1 dbi &&
well_formed_closed_ex_aux ϕ2 dbi
erewrite -> IHϕ1 by eassumption .Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ2 dbin', dbi : db_index H0 : well_formed_closed_ex_aux ϕ1^{{evar :x↦n'}} dbi =
true H1 : well_formed_closed_ex_aux ϕ2^{{evar :x↦n'}} dbi =
true
true && well_formed_closed_ex_aux ϕ2 dbi
erewrite -> IHϕ2 by eassumption .Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ2 dbin', dbi : db_index H0 : well_formed_closed_ex_aux ϕ1^{{evar :x↦n'}} dbi =
true H1 : well_formed_closed_ex_aux ϕ2^{{evar :x↦n'}} dbi =
true
true && true
reflexivity .
- Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ2 dbin', dbi : db_index H : well_formed_closed_ex_aux ϕ1^{{evar :x↦n'}} dbi &&
well_formed_closed_ex_aux ϕ2^{{evar :x↦n'}} dbi =
true
well_formed_closed_ex_aux ϕ1 dbi &&
well_formed_closed_ex_aux ϕ2 dbi
destruct_and!. Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ2 dbin', dbi : db_index H0 : well_formed_closed_ex_aux ϕ1^{{evar :x↦n'}} dbi =
true H1 : well_formed_closed_ex_aux ϕ2^{{evar :x↦n'}} dbi =
true
well_formed_closed_ex_aux ϕ1 dbi &&
well_formed_closed_ex_aux ϕ2 dbi
erewrite -> IHϕ1 by eassumption .Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ2 dbin', dbi : db_index H0 : well_formed_closed_ex_aux ϕ1^{{evar :x↦n'}} dbi =
true H1 : well_formed_closed_ex_aux ϕ2^{{evar :x↦n'}} dbi =
true
true && well_formed_closed_ex_aux ϕ2 dbi
erewrite -> IHϕ2 by eassumption .Σ : Signature x : evar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ1^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ1 dbiIHϕ2 : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ2^{{evar :x↦n}} dbi =
true → well_formed_closed_ex_aux ϕ2 dbin', dbi : db_index H0 : well_formed_closed_ex_aux ϕ1^{{evar :x↦n'}} dbi =
true H1 : well_formed_closed_ex_aux ϕ2^{{evar :x↦n'}} dbi =
true
true && true
reflexivity .
- Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ^{{evar :x↦n}} dbi = true
→ well_formed_closed_ex_aux ϕ dbin', dbi : db_index H : well_formed_closed_ex_aux ϕ^{{evar :x↦S n'}}
(S dbi) = true
well_formed_closed_ex_aux ϕ (S dbi)
erewrite IHϕ by eassumption .Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ^{{evar :x↦n}} dbi = true
→ well_formed_closed_ex_aux ϕ dbin', dbi : db_index H : well_formed_closed_ex_aux ϕ^{{evar :x↦S n'}}
(S dbi) = true
true
reflexivity .
- Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ^{{evar :x↦n}} dbi = true
→ well_formed_closed_ex_aux ϕ dbin', dbi : db_index H : well_formed_closed_ex_aux ϕ^{{evar :x↦n'}} dbi =
true
well_formed_closed_ex_aux ϕ dbi
simpl .Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ^{{evar :x↦n}} dbi = true
→ well_formed_closed_ex_aux ϕ dbin', dbi : db_index H : well_formed_closed_ex_aux ϕ^{{evar :x↦n'}} dbi =
true
well_formed_closed_ex_aux ϕ dbi
erewrite -> IHϕ by eassumption .Σ : Signature x : evar ϕ : Pattern IHϕ : ∀ n dbi : db_index,
well_formed_closed_ex_aux ϕ^{{evar :x↦n}} dbi = true
→ well_formed_closed_ex_aux ϕ dbin', dbi : db_index H : well_formed_closed_ex_aux ϕ^{{evar :x↦n'}} dbi =
true
true
reflexivity .
Qed .
Lemma nno_free_svar_subst dbi ϕ ψ X :
well_formed_closed_mu_aux ψ dbi ->
no_negative_occurrence_db_b dbi (ϕ^[[svar: X ↦ ψ]])
= no_negative_occurrence_db_b dbi ϕ
with npo_free_svar_subst dbi ϕ ψ X:
well_formed_closed_mu_aux ψ dbi ->
no_positive_occurrence_db_b dbi (ϕ^[[svar: X ↦ ψ]])
= no_positive_occurrence_db_b dbi ϕ.Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕdbi : db_index ϕ, ψ : Pattern X : svar
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ
Proof .Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕdbi : db_index ϕ, ψ : Pattern X : svar
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ
- Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕdbi : db_index ϕ, ψ : Pattern X : svar
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ
move : dbi.Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ, ψ : Pattern X : svar
∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ
induction ϕ; intros dbi Hwf; simpl ; auto .Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕx : svar ψ : Pattern X : svar dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_negative_occurrence_db_b dbi
(if decide (X = x) then ψ else patt_free_svar x) =
no_negative_occurrence_db_b dbi (patt_free_svar x)
+ Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕx : svar ψ : Pattern X : svar dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_negative_occurrence_db_b dbi
(if decide (X = x) then ψ else patt_free_svar x) =
no_negative_occurrence_db_b dbi (patt_free_svar x)
case_match; cbn ; [|reflexivity ]. Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕx : svar ψ : Pattern X : svar dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi e : X = x H : decide (X = x) = left e
no_negative_occurrence_db_b dbi ψ = true
eapply Private_wfc_impl_no_neg_pos_occ.Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕx : svar ψ : Pattern X : svar dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi e : X = x H : decide (X = x) = left e
well_formed_closed_mu_aux ψ ?maxsvar = true
exact Hwf.Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕx : svar ψ : Pattern X : svar dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi e : X = x H : decide (X = x) = left e
dbi ≤ dbi
lia .
+ Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ1^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ2^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_negative_occurrence_db_b dbi
(patt_app ϕ1^[[svar:X↦ψ]] ϕ2^[[svar:X↦ψ]]) =
no_negative_occurrence_db_b dbi (patt_app ϕ1 ϕ2)
cbn .Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ1^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ2^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_negative_occurrence_db_b dbi ϕ1^[[svar:X↦ψ]] &&
no_negative_occurrence_db_b dbi ϕ2^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ1 &&
no_negative_occurrence_db_b dbi ϕ2
rewrite IHϕ1; auto .Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ1^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ2^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_negative_occurrence_db_b dbi ϕ1 &&
no_negative_occurrence_db_b dbi ϕ2^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ1 &&
no_negative_occurrence_db_b dbi ϕ2
rewrite IHϕ2; auto .
+ Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ1^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ2^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_negative_occurrence_db_b dbi
(patt_imp ϕ1^[[svar:X↦ψ]] ϕ2^[[svar:X↦ψ]]) =
no_negative_occurrence_db_b dbi (patt_imp ϕ1 ϕ2)
cbn .Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ1^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ2^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi ϕ1^[[svar:X↦ψ]] &&
no_negative_occurrence_db_b dbi ϕ2^[[svar:X↦ψ]] =
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi ϕ1 &&
no_negative_occurrence_db_b dbi ϕ2
fold (no_positive_occurrence_db_b).Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ1^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ2^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_positive_occurrence_db_b dbi ϕ1^[[svar:X↦ψ]] &&
no_negative_occurrence_db_b dbi ϕ2^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ1 &&
no_negative_occurrence_db_b dbi ϕ2
rewrite nno_free_svar_subst; auto .Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ1^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ2^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_positive_occurrence_db_b dbi ϕ1^[[svar:X↦ψ]] &&
no_negative_occurrence_db_b dbi ϕ2 =
no_positive_occurrence_db_b dbi ϕ1 &&
no_negative_occurrence_db_b dbi ϕ2
rewrite npo_free_svar_subst; auto .
+ Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ, ψ : Pattern X : svar IHϕ : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕdbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_negative_occurrence_db_b dbi
(patt_exists ϕ^[[svar:X↦ψ]]) =
no_negative_occurrence_db_b dbi (patt_exists ϕ)
cbn .Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ, ψ : Pattern X : svar IHϕ : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕdbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_negative_occurrence_db_b dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ
rewrite IHϕ; auto .
+ Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ, ψ : Pattern X : svar IHϕ : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕdbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_negative_occurrence_db_b dbi
(patt_mu ϕ^[[svar:X↦ψ]]) =
no_negative_occurrence_db_b dbi (patt_mu ϕ)
cbn .Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ, ψ : Pattern X : svar IHϕ : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕdbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_negative_occurrence_db_b (S dbi) ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b (S dbi) ϕ
rewrite IHϕ; auto .Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ, ψ : Pattern X : svar IHϕ : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕdbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
well_formed_closed_mu_aux ψ (S dbi)
eapply well_formed_closed_mu_aux_ind.Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ, ψ : Pattern X : svar IHϕ : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕdbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
?ind_svar1 ≤ S dbi
2 : exact Hwf.Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ, ψ : Pattern X : svar IHϕ : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_negative_occurrence_db_b dbi
ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕdbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
dbi ≤ S dbi
lia .
- Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕdbi : db_index ϕ, ψ : Pattern X : svar
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ
move : dbi.Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ, ψ : Pattern X : svar
∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ
induction ϕ; intros dbi Hwf; simpl ; auto .Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕx : svar ψ : Pattern X : svar dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_positive_occurrence_db_b dbi
(if decide (X = x) then ψ else patt_free_svar x) =
no_positive_occurrence_db_b dbi (patt_free_svar x)
+ Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕx : svar ψ : Pattern X : svar dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_positive_occurrence_db_b dbi
(if decide (X = x) then ψ else patt_free_svar x) =
no_positive_occurrence_db_b dbi (patt_free_svar x)
case_match; cbn ; [|reflexivity ]. Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕx : svar ψ : Pattern X : svar dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi e : X = x H : decide (X = x) = left e
no_positive_occurrence_db_b dbi ψ = true
eapply Private_wfc_impl_no_neg_pos_occ.Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕx : svar ψ : Pattern X : svar dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi e : X = x H : decide (X = x) = left e
well_formed_closed_mu_aux ψ ?maxsvar = true
exact Hwf.Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕx : svar ψ : Pattern X : svar dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi e : X = x H : decide (X = x) = left e
dbi ≤ dbi
lia .
+ Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ1^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ2^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_positive_occurrence_db_b dbi
(patt_app ϕ1^[[svar:X↦ψ]] ϕ2^[[svar:X↦ψ]]) =
no_positive_occurrence_db_b dbi (patt_app ϕ1 ϕ2)
cbn .Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ1^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ2^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_positive_occurrence_db_b dbi ϕ1^[[svar:X↦ψ]] &&
no_positive_occurrence_db_b dbi ϕ2^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ1 &&
no_positive_occurrence_db_b dbi ϕ2
rewrite IHϕ1; auto .Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ1^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ2^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_positive_occurrence_db_b dbi ϕ1 &&
no_positive_occurrence_db_b dbi ϕ2^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ1 &&
no_positive_occurrence_db_b dbi ϕ2
rewrite IHϕ2; auto .
+ Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ1^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ2^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_positive_occurrence_db_b dbi
(patt_imp ϕ1^[[svar:X↦ψ]] ϕ2^[[svar:X↦ψ]]) =
no_positive_occurrence_db_b dbi (patt_imp ϕ1 ϕ2)
cbn .Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ1^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ2^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi ϕ1^[[svar:X↦ψ]] &&
no_positive_occurrence_db_b dbi ϕ2^[[svar:X↦ψ]] =
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi ϕ1 &&
no_positive_occurrence_db_b dbi ϕ2
fold (no_negative_occurrence_db_b).Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ1^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ2^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_negative_occurrence_db_b dbi ϕ1^[[svar:X↦ψ]] &&
no_positive_occurrence_db_b dbi ϕ2^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ1 &&
no_positive_occurrence_db_b dbi ϕ2
rewrite nno_free_svar_subst; auto .Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ1, ϕ2, ψ : Pattern X : svar IHϕ1 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ1^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ1IHϕ2 : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ2^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ2dbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_negative_occurrence_db_b dbi ϕ1 &&
no_positive_occurrence_db_b dbi ϕ2^[[svar:X↦ψ]] =
no_negative_occurrence_db_b dbi ϕ1 &&
no_positive_occurrence_db_b dbi ϕ2
rewrite IHϕ2; auto .
+ Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ, ψ : Pattern X : svar IHϕ : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕdbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_positive_occurrence_db_b dbi
(patt_exists ϕ^[[svar:X↦ψ]]) =
no_positive_occurrence_db_b dbi (patt_exists ϕ)
cbn .Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ, ψ : Pattern X : svar IHϕ : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕdbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_positive_occurrence_db_b dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕ
rewrite IHϕ; auto .
+ Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ, ψ : Pattern X : svar IHϕ : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕdbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_positive_occurrence_db_b dbi
(patt_mu ϕ^[[svar:X↦ψ]]) =
no_positive_occurrence_db_b dbi (patt_mu ϕ)
cbn .Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ, ψ : Pattern X : svar IHϕ : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕdbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
no_positive_occurrence_db_b (S dbi) ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b (S dbi) ϕ
rewrite IHϕ; auto .Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ, ψ : Pattern X : svar IHϕ : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕdbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
well_formed_closed_mu_aux ψ (S dbi)
eapply well_formed_closed_mu_aux_ind.Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ, ψ : Pattern X : svar IHϕ : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕdbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
?ind_svar1 ≤ S dbi
2 : exact Hwf.Σ : Signature nno_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_negative_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_negative_occurrence_db_b
dbi ϕnpo_free_svar_subst : ∀ (dbi : db_index)
(ϕ ψ : Pattern)
(X : svar),
well_formed_closed_mu_aux ψ
dbi
→ no_positive_occurrence_db_b
dbi ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b
dbi ϕϕ, ψ : Pattern X : svar IHϕ : ∀ dbi : db_index,
well_formed_closed_mu_aux ψ dbi
→ no_positive_occurrence_db_b dbi
ϕ^[[svar:X↦ψ]] =
no_positive_occurrence_db_b dbi ϕdbi : db_index Hwf : well_formed_closed_mu_aux ψ dbi
dbi ≤ S dbi
lia .
Qed .
Lemma wfp_free_svar_subst_1 ϕ ψ X :
well_formed_closed ψ = true ->
well_formed_positive ψ = true ->
well_formed_positive ϕ = true ->
well_formed_positive (ϕ^[[svar: X ↦ ψ]]) = true.Σ : Signature ϕ, ψ : Pattern X : svar
well_formed_closed ψ = true
→ well_formed_positive ψ = true
→ well_formed_positive ϕ = true
→ well_formed_positive ϕ^[[svar:X↦ψ]] = true
Proof .Σ : Signature ϕ, ψ : Pattern X : svar
well_formed_closed ψ = true
→ well_formed_positive ψ = true
→ well_formed_positive ϕ = true
→ well_formed_positive ϕ^[[svar:X↦ψ]] = true
intros wfcψ wfpψ wfpϕ.Σ : Signature ϕ, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true wfpϕ : well_formed_positive ϕ = true
well_formed_positive ϕ^[[svar:X↦ψ]] = true
induction ϕ; simpl ; auto .Σ : Signature x : svar ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true wfpϕ : well_formed_positive (patt_free_svar x) = true
well_formed_positive
(if decide (X = x) then ψ else patt_free_svar x) =
true
- Σ : Signature x : svar ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true wfpϕ : well_formed_positive (patt_free_svar x) = true
well_formed_positive
(if decide (X = x) then ψ else patt_free_svar x) =
true
case_match; auto .
- Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true wfpϕ : well_formed_positive (patt_app ϕ1 ϕ2) = true IHϕ1 : well_formed_positive ϕ1 = true
→ well_formed_positive ϕ1^[[svar:X↦ψ]] = true IHϕ2 : well_formed_positive ϕ2 = true
→ well_formed_positive ϕ2^[[svar:X↦ψ]] = true
well_formed_positive ϕ1^[[svar:X↦ψ]] &&
well_formed_positive ϕ2^[[svar:X↦ψ]] = true
simpl in wfpϕ.Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true wfpϕ : well_formed_positive ϕ1 &&
well_formed_positive ϕ2 = true IHϕ1 : well_formed_positive ϕ1 = true
→ well_formed_positive ϕ1^[[svar:X↦ψ]] = true IHϕ2 : well_formed_positive ϕ2 = true
→ well_formed_positive ϕ2^[[svar:X↦ψ]] = true
well_formed_positive ϕ1^[[svar:X↦ψ]] &&
well_formed_positive ϕ2^[[svar:X↦ψ]] = true
destruct_and!. Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true H : well_formed_positive ϕ1 = true H0 : well_formed_positive ϕ2 = true IHϕ1 : well_formed_positive ϕ1 = true
→ well_formed_positive ϕ1^[[svar:X↦ψ]] = true IHϕ2 : well_formed_positive ϕ2 = true
→ well_formed_positive ϕ2^[[svar:X↦ψ]] = true
well_formed_positive ϕ1^[[svar:X↦ψ]] &&
well_formed_positive ϕ2^[[svar:X↦ψ]] = true
rewrite -> IHϕ1 by assumption .Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true H : well_formed_positive ϕ1 = true H0 : well_formed_positive ϕ2 = true IHϕ1 : well_formed_positive ϕ1 = true
→ well_formed_positive ϕ1^[[svar:X↦ψ]] = true IHϕ2 : well_formed_positive ϕ2 = true
→ well_formed_positive ϕ2^[[svar:X↦ψ]] = true
true && well_formed_positive ϕ2^[[svar:X↦ψ]] = true
rewrite -> IHϕ2 by assumption .Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true H : well_formed_positive ϕ1 = true H0 : well_formed_positive ϕ2 = true IHϕ1 : well_formed_positive ϕ1 = true
→ well_formed_positive ϕ1^[[svar:X↦ψ]] = true IHϕ2 : well_formed_positive ϕ2 = true
→ well_formed_positive ϕ2^[[svar:X↦ψ]] = true
true && true = true
reflexivity .
- Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true wfpϕ : well_formed_positive (patt_imp ϕ1 ϕ2) = true IHϕ1 : well_formed_positive ϕ1 = true
→ well_formed_positive ϕ1^[[svar:X↦ψ]] = true IHϕ2 : well_formed_positive ϕ2 = true
→ well_formed_positive ϕ2^[[svar:X↦ψ]] = true
well_formed_positive ϕ1^[[svar:X↦ψ]] &&
well_formed_positive ϕ2^[[svar:X↦ψ]] = true
simpl in wfpϕ.Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true wfpϕ : well_formed_positive ϕ1 &&
well_formed_positive ϕ2 = true IHϕ1 : well_formed_positive ϕ1 = true
→ well_formed_positive ϕ1^[[svar:X↦ψ]] = true IHϕ2 : well_formed_positive ϕ2 = true
→ well_formed_positive ϕ2^[[svar:X↦ψ]] = true
well_formed_positive ϕ1^[[svar:X↦ψ]] &&
well_formed_positive ϕ2^[[svar:X↦ψ]] = true
destruct_and!. Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true H : well_formed_positive ϕ1 = true H0 : well_formed_positive ϕ2 = true IHϕ1 : well_formed_positive ϕ1 = true
→ well_formed_positive ϕ1^[[svar:X↦ψ]] = true IHϕ2 : well_formed_positive ϕ2 = true
→ well_formed_positive ϕ2^[[svar:X↦ψ]] = true
well_formed_positive ϕ1^[[svar:X↦ψ]] &&
well_formed_positive ϕ2^[[svar:X↦ψ]] = true
rewrite -> IHϕ1 by assumption .Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true H : well_formed_positive ϕ1 = true H0 : well_formed_positive ϕ2 = true IHϕ1 : well_formed_positive ϕ1 = true
→ well_formed_positive ϕ1^[[svar:X↦ψ]] = true IHϕ2 : well_formed_positive ϕ2 = true
→ well_formed_positive ϕ2^[[svar:X↦ψ]] = true
true && well_formed_positive ϕ2^[[svar:X↦ψ]] = true
rewrite -> IHϕ2 by assumption .Σ : Signature ϕ1, ϕ2, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true H : well_formed_positive ϕ1 = true H0 : well_formed_positive ϕ2 = true IHϕ1 : well_formed_positive ϕ1 = true
→ well_formed_positive ϕ1^[[svar:X↦ψ]] = true IHϕ2 : well_formed_positive ϕ2 = true
→ well_formed_positive ϕ2^[[svar:X↦ψ]] = true
true && true = true
reflexivity .
- Σ : Signature ϕ, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true wfpϕ : well_formed_positive (patt_mu ϕ) = true IHϕ : well_formed_positive ϕ = true
→ well_formed_positive ϕ^[[svar:X↦ψ]] = true
no_negative_occurrence_db_b 0 ϕ^[[svar:X↦ψ]] &&
well_formed_positive ϕ^[[svar:X↦ψ]] = true
simpl in wfpϕ.Σ : Signature ϕ, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true wfpϕ : no_negative_occurrence_db_b 0 ϕ &&
well_formed_positive ϕ = true IHϕ : well_formed_positive ϕ = true
→ well_formed_positive ϕ^[[svar:X↦ψ]] = true
no_negative_occurrence_db_b 0 ϕ^[[svar:X↦ψ]] &&
well_formed_positive ϕ^[[svar:X↦ψ]] = true
destruct_and!. Σ : Signature ϕ, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true H : no_negative_occurrence_db_b 0 ϕ = true H0 : well_formed_positive ϕ = true IHϕ : well_formed_positive ϕ = true
→ well_formed_positive ϕ^[[svar:X↦ψ]] = true
no_negative_occurrence_db_b 0 ϕ^[[svar:X↦ψ]] &&
well_formed_positive ϕ^[[svar:X↦ψ]] = true
specialize (IHϕ H0).Σ : Signature ϕ, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true H : no_negative_occurrence_db_b 0 ϕ = true H0 : well_formed_positive ϕ = true IHϕ : well_formed_positive ϕ^[[svar:X↦ψ]] = true
no_negative_occurrence_db_b 0 ϕ^[[svar:X↦ψ]] &&
well_formed_positive ϕ^[[svar:X↦ψ]] = true
rewrite -> IHϕ.Σ : Signature ϕ, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true H : no_negative_occurrence_db_b 0 ϕ = true H0 : well_formed_positive ϕ = true IHϕ : well_formed_positive ϕ^[[svar:X↦ψ]] = true
no_negative_occurrence_db_b 0 ϕ^[[svar:X↦ψ]] && true =
true
rewrite nno_free_svar_subst.Σ : Signature ϕ, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true H : no_negative_occurrence_db_b 0 ϕ = true H0 : well_formed_positive ϕ = true IHϕ : well_formed_positive ϕ^[[svar:X↦ψ]] = true
well_formed_closed_mu_aux ψ 0
{ Σ : Signature ϕ, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true H : no_negative_occurrence_db_b 0 ϕ = true H0 : well_formed_positive ϕ = true IHϕ : well_formed_positive ϕ^[[svar:X↦ψ]] = true
well_formed_closed_mu_aux ψ 0
apply andb_true_iff in wfcψ.Σ : Signature ϕ, ψ : Pattern X : svar wfcψ : well_formed_closed_mu_aux ψ 0 = true
∧ well_formed_closed_ex_aux ψ 0 = true wfpψ : well_formed_positive ψ = true H : no_negative_occurrence_db_b 0 ϕ = true H0 : well_formed_positive ϕ = true IHϕ : well_formed_positive ϕ^[[svar:X↦ψ]] = true
well_formed_closed_mu_aux ψ 0
apply wfcψ. } Σ : Signature ϕ, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true H : no_negative_occurrence_db_b 0 ϕ = true H0 : well_formed_positive ϕ = true IHϕ : well_formed_positive ϕ^[[svar:X↦ψ]] = true
no_negative_occurrence_db_b 0 ϕ && true = true
rewrite H.Σ : Signature ϕ, ψ : Pattern X : svar wfcψ : well_formed_closed ψ = true wfpψ : well_formed_positive ψ = true H : no_negative_occurrence_db_b 0 ϕ = true H0 : well_formed_positive ϕ = true IHϕ : well_formed_positive ϕ^[[svar:X↦ψ]] = true
true && true = true
reflexivity .
Qed .
Lemma Private_no_negative_occurrence_svar_quantify ϕ level X :
(
no_negative_occurrence_db_b level ϕ = true ->
svar_has_negative_occurrence X ϕ = false ->
no_negative_occurrence_db_b level (ϕ^{{svar: X ↦ level}}) = true
)
/\
(
no_positive_occurrence_db_b level ϕ = true ->
svar_has_positive_occurrence X ϕ = false ->
no_positive_occurrence_db_b level (ϕ^{{svar: X ↦ level}}) = true
).Σ : Signature ϕ : Pattern level : db_index X : svar
(no_negative_occurrence_db_b level ϕ = true
→ svar_has_negative_occurrence X ϕ = false
→ no_negative_occurrence_db_b level
ϕ^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ = true
→ svar_has_positive_occurrence X ϕ = false
→ no_positive_occurrence_db_b level
ϕ^{{svar:X↦level}} = true)
Proof .Σ : Signature ϕ : Pattern level : db_index X : svar
(no_negative_occurrence_db_b level ϕ = true
→ svar_has_negative_occurrence X ϕ = false
→ no_negative_occurrence_db_b level
ϕ^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ = true
→ svar_has_positive_occurrence X ϕ = false
→ no_positive_occurrence_db_b level
ϕ^{{svar:X↦level}} = true)
move : level.Σ : Signature ϕ : Pattern X : svar
∀ level : db_index,
(no_negative_occurrence_db_b level ϕ = true
→ svar_has_negative_occurrence X ϕ = false
→ no_negative_occurrence_db_b level
ϕ^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ = true
→ svar_has_positive_occurrence X ϕ = false
→ no_positive_occurrence_db_b level
ϕ^{{svar:X↦level}} = true)
induction ϕ; intros level; split ; intros HnoX Hnolevel; cbn in *; auto .Σ : Signature x, X : svar level : db_index HnoX : true = true Hnolevel : false = false
no_negative_occurrence_db_b level
(if decide (X = x)
then patt_bound_svar level
else patt_free_svar x) = true
- Σ : Signature x, X : svar level : db_index HnoX : true = true Hnolevel : false = false
no_negative_occurrence_db_b level
(if decide (X = x)
then patt_bound_svar level
else patt_free_svar x) = true
case_match; reflexivity .
- Σ : Signature x, X : svar level : db_index HnoX : true = true Hnolevel : (if decide (X = x) then true else false) =
false
no_positive_occurrence_db_b level
(if decide (X = x)
then patt_bound_svar level
else patt_free_svar x) = true
case_match; cbn . Σ : Signature x, X : svar level : db_index HnoX : true = true e : X = x H : decide (X = x) = left e Hnolevel : true = false
(if decide (level = level) then false else true) =
true
2 : reflexivity .Σ : Signature x, X : svar level : db_index HnoX : true = true e : X = x H : decide (X = x) = left e Hnolevel : true = false
(if decide (level = level) then false else true) =
true
congruence .
- Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index HnoX : no_negative_occurrence_db_b level ϕ1 &&
no_negative_occurrence_db_b level ϕ2 = true Hnolevel : svar_has_negative_occurrence X ϕ1
|| svar_has_negative_occurrence X ϕ2 =
false
no_negative_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
apply orb_false_iff in Hnolevel.Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index HnoX : no_negative_occurrence_db_b level ϕ1 &&
no_negative_occurrence_db_b level ϕ2 = true Hnolevel : svar_has_negative_occurrence X ϕ1 = false
∧ svar_has_negative_occurrence X ϕ2 = false
no_negative_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
destruct_and!. Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : no_negative_occurrence_db_b level ϕ1 = true H2 : no_negative_occurrence_db_b level ϕ2 = true H : svar_has_negative_occurrence X ϕ1 = false H0 : svar_has_negative_occurrence X ϕ2 = false
no_negative_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
pose proof (IH1 := IHϕ1 level).Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : no_negative_occurrence_db_b level ϕ1 = true H2 : no_negative_occurrence_db_b level ϕ2 = true H : svar_has_negative_occurrence X ϕ1 = false H0 : svar_has_negative_occurrence X ϕ2 = false IH1 : (no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 = true
→ svar_has_positive_occurrence X ϕ1 = false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
no_negative_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
destruct IH1 as [IH11 _].Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : no_negative_occurrence_db_b level ϕ1 = true H2 : no_negative_occurrence_db_b level ϕ2 = true H : svar_has_negative_occurrence X ϕ1 = false H0 : svar_has_negative_occurrence X ϕ2 = false IH11 : no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true
no_negative_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
specialize (IH11 ltac :(assumption ) ltac :(assumption )).Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : no_negative_occurrence_db_b level ϕ1 = true H2 : no_negative_occurrence_db_b level ϕ2 = true H : svar_has_negative_occurrence X ϕ1 = false H0 : svar_has_negative_occurrence X ϕ2 = false IH11 : no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true
no_negative_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
pose proof (IH2 := IHϕ2 level).Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : no_negative_occurrence_db_b level ϕ1 = true H2 : no_negative_occurrence_db_b level ϕ2 = true H : svar_has_negative_occurrence X ϕ1 = false H0 : svar_has_negative_occurrence X ϕ2 = false IH11 : no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true IH2 : (no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 = true
→ svar_has_positive_occurrence X ϕ2 = false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
no_negative_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
destruct IH2 as [IH21 _].Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : no_negative_occurrence_db_b level ϕ1 = true H2 : no_negative_occurrence_db_b level ϕ2 = true H : svar_has_negative_occurrence X ϕ1 = false H0 : svar_has_negative_occurrence X ϕ2 = false IH11 : no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true IH21 : no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true
no_negative_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
specialize (IH21 ltac :(assumption ) ltac :(assumption )).Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : no_negative_occurrence_db_b level ϕ1 = true H2 : no_negative_occurrence_db_b level ϕ2 = true H : svar_has_negative_occurrence X ϕ1 = false H0 : svar_has_negative_occurrence X ϕ2 = false IH11 : no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true IH21 : no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true
no_negative_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
split_and!; assumption .
- Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index HnoX : no_positive_occurrence_db_b level ϕ1 &&
no_positive_occurrence_db_b level ϕ2 = true Hnolevel : svar_has_positive_occurrence X ϕ1
|| svar_has_positive_occurrence X ϕ2 =
false
no_positive_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
apply orb_false_iff in Hnolevel.Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index HnoX : no_positive_occurrence_db_b level ϕ1 &&
no_positive_occurrence_db_b level ϕ2 = true Hnolevel : svar_has_positive_occurrence X ϕ1 = false
∧ svar_has_positive_occurrence X ϕ2 = false
no_positive_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
destruct_and!. Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : no_positive_occurrence_db_b level ϕ1 = true H2 : no_positive_occurrence_db_b level ϕ2 = true H : svar_has_positive_occurrence X ϕ1 = false H0 : svar_has_positive_occurrence X ϕ2 = false
no_positive_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
pose proof (IH1 := IHϕ1 level).Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : no_positive_occurrence_db_b level ϕ1 = true H2 : no_positive_occurrence_db_b level ϕ2 = true H : svar_has_positive_occurrence X ϕ1 = false H0 : svar_has_positive_occurrence X ϕ2 = false IH1 : (no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 = true
→ svar_has_positive_occurrence X ϕ1 = false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
no_positive_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
destruct IH1 as [_ IH12].Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : no_positive_occurrence_db_b level ϕ1 = true H2 : no_positive_occurrence_db_b level ϕ2 = true H : svar_has_positive_occurrence X ϕ1 = false H0 : svar_has_positive_occurrence X ϕ2 = false IH12 : no_positive_occurrence_db_b level ϕ1 = true
→ svar_has_positive_occurrence X ϕ1 = false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true
no_positive_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
specialize (IH12 ltac :(assumption ) ltac :(assumption )).Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : no_positive_occurrence_db_b level ϕ1 = true H2 : no_positive_occurrence_db_b level ϕ2 = true H : svar_has_positive_occurrence X ϕ1 = false H0 : svar_has_positive_occurrence X ϕ2 = false IH12 : no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true
no_positive_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
pose proof (IH2 := IHϕ2 level).Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : no_positive_occurrence_db_b level ϕ1 = true H2 : no_positive_occurrence_db_b level ϕ2 = true H : svar_has_positive_occurrence X ϕ1 = false H0 : svar_has_positive_occurrence X ϕ2 = false IH12 : no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true IH2 : (no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 = true
→ svar_has_positive_occurrence X ϕ2 = false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
no_positive_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
destruct IH2 as [_ IH22].Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : no_positive_occurrence_db_b level ϕ1 = true H2 : no_positive_occurrence_db_b level ϕ2 = true H : svar_has_positive_occurrence X ϕ1 = false H0 : svar_has_positive_occurrence X ϕ2 = false IH12 : no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true IH22 : no_positive_occurrence_db_b level ϕ2 = true
→ svar_has_positive_occurrence X ϕ2 = false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true
no_positive_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
specialize (IH22 ltac :(assumption ) ltac :(assumption )).Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : no_positive_occurrence_db_b level ϕ1 = true H2 : no_positive_occurrence_db_b level ϕ2 = true H : svar_has_positive_occurrence X ϕ1 = false H0 : svar_has_positive_occurrence X ϕ2 = false IH12 : no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true IH22 : no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true
no_positive_occurrence_db_b level ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
split_and!; assumption .
- Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index HnoX : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level ϕ1 &&
no_negative_occurrence_db_b level ϕ2 = true Hnolevel : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X')
then true
else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X ϕ1
|| svar_has_negative_occurrence X ϕ2 =
false
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
apply orb_false_iff in Hnolevel.Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index HnoX : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level ϕ1 &&
no_negative_occurrence_db_b level ϕ2 = true Hnolevel : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X')
then true
else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X ϕ1 = false
∧ svar_has_negative_occurrence X ϕ2 = false
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
destruct_and!. Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level ϕ1 = true H2 : no_negative_occurrence_db_b level ϕ2 = true H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X ϕ1 = false H0 : svar_has_negative_occurrence X ϕ2 = false
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
pose proof (IH1 := IHϕ1 level).Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level ϕ1 = true H2 : no_negative_occurrence_db_b level ϕ2 = true H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X ϕ1 = false H0 : svar_has_negative_occurrence X ϕ2 = false IH1 : (no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 = true
→ svar_has_positive_occurrence X ϕ1 = false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
destruct IH1 as [_ IH12].Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level ϕ1 = true H2 : no_negative_occurrence_db_b level ϕ2 = true H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X ϕ1 = false H0 : svar_has_negative_occurrence X ϕ2 = false IH12 : no_positive_occurrence_db_b level ϕ1 = true
→ svar_has_positive_occurrence X ϕ1 = false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
specialize (IH12 ltac :(assumption ) ltac :(assumption )).Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level ϕ1 = true H2 : no_negative_occurrence_db_b level ϕ2 = true H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X ϕ1 = false H0 : svar_has_negative_occurrence X ϕ2 = false IH12 : no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
pose proof (IH2 := IHϕ2 level).Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level ϕ1 = true H2 : no_negative_occurrence_db_b level ϕ2 = true H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X ϕ1 = false H0 : svar_has_negative_occurrence X ϕ2 = false IH12 : no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true IH2 : (no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 = true
→ svar_has_positive_occurrence X ϕ2 = false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
destruct IH2 as [IH21 _].Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level ϕ1 = true H2 : no_negative_occurrence_db_b level ϕ2 = true H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X ϕ1 = false H0 : svar_has_negative_occurrence X ϕ2 = false IH12 : no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true IH21 : no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
specialize (IH21 ltac :(assumption ) ltac :(assumption )).Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level ϕ1 = true H2 : no_negative_occurrence_db_b level ϕ2 = true H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_positive_occurrence) X ϕ1 = false H0 : svar_has_negative_occurrence X ϕ2 = false IH12 : no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true IH21 : no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_negative_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
split_and!; assumption .
- Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index HnoX : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level ϕ1 &&
no_positive_occurrence_db_b level ϕ2 = true Hnolevel : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X')
then true
else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X ϕ1
|| svar_has_positive_occurrence X ϕ2 =
false
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
apply orb_false_iff in Hnolevel.Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index HnoX : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level ϕ1 &&
no_positive_occurrence_db_b level ϕ2 = true Hnolevel : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X')
then true
else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X ϕ1 = false
∧ svar_has_positive_occurrence X ϕ2 = false
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
destruct_and!. Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level ϕ1 = true H2 : no_positive_occurrence_db_b level ϕ2 = true H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X ϕ1 = false H0 : svar_has_positive_occurrence X ϕ2 = false
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
pose proof (IH1 := IHϕ1 level).Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level ϕ1 = true H2 : no_positive_occurrence_db_b level ϕ2 = true H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X ϕ1 = false H0 : svar_has_positive_occurrence X ϕ2 = false IH1 : (no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 = true
→ svar_has_positive_occurrence X ϕ1 = false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
destruct IH1 as [IH11 _].Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level ϕ1 = true H2 : no_positive_occurrence_db_b level ϕ2 = true H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X ϕ1 = false H0 : svar_has_positive_occurrence X ϕ2 = false IH11 : no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
specialize (IH11 ltac :(assumption ) ltac :(assumption )).Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level ϕ1 = true H2 : no_positive_occurrence_db_b level ϕ2 = true H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X ϕ1 = false H0 : svar_has_positive_occurrence X ϕ2 = false IH11 : no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
pose proof (IH2 := IHϕ2 level).Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level ϕ1 = true H2 : no_positive_occurrence_db_b level ϕ2 = true H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X ϕ1 = false H0 : svar_has_positive_occurrence X ϕ2 = false IH11 : no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true IH2 : (no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 = true
→ svar_has_positive_occurrence X ϕ2 = false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
destruct IH2 as [_ IH22].Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level ϕ1 = true H2 : no_positive_occurrence_db_b level ϕ2 = true H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X ϕ1 = false H0 : svar_has_positive_occurrence X ϕ2 = false IH11 : no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true IH22 : no_positive_occurrence_db_b level ϕ2 = true
→ svar_has_positive_occurrence X ϕ2 = false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
specialize (IH22 ltac :(assumption ) ltac :(assumption )).Σ : Signature ϕ1, ϕ2 : Pattern X : svar IHϕ1 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ1 = true
→ svar_has_negative_occurrence X ϕ1 = false
→ no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ1 =
true
→ svar_has_positive_occurrence X ϕ1 =
false
→ no_positive_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true)IHϕ2 : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ2 = true
→ svar_has_negative_occurrence X ϕ2 = false
→ no_negative_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ2 =
true
→ svar_has_positive_occurrence X ϕ2 =
false
→ no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true)level : db_index H1 : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level ϕ1 = true H2 : no_positive_occurrence_db_b level ϕ2 = true H : (fix svar_has_positive_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_svar X' =>
if decide (X = X') then true else false
| patt_app ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_positive_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_positive_occurrence X ϕ'
| _ => false
end
with svar_has_negative_occurrence
(X : svar) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
svar_has_negative_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
svar_has_positive_occurrence X ϕ₁
|| svar_has_negative_occurrence X ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
svar_has_negative_occurrence X ϕ'
| _ => false
end
for
svar_has_negative_occurrence) X ϕ1 = false H0 : svar_has_positive_occurrence X ϕ2 = false IH11 : no_negative_occurrence_db_b level
ϕ1^{{svar:X↦level}} = true IH22 : no_positive_occurrence_db_b level
ϕ2^{{svar:X↦level}} = true
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) level
ϕ1^{{svar:X↦level}} &&
no_positive_occurrence_db_b level ϕ2^{{svar:X↦level}} =
true
split_and!; assumption .
- Σ : Signature ϕ : Pattern X : svar IHϕ : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ = true
→ svar_has_negative_occurrence X ϕ = false
→ no_negative_occurrence_db_b level ϕ^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ = true
→ svar_has_positive_occurrence X ϕ = false
→ no_positive_occurrence_db_b level ϕ^{{svar:X↦level}} = true)level : db_index HnoX : no_negative_occurrence_db_b level ϕ = true Hnolevel : svar_has_negative_occurrence X ϕ = false
no_negative_occurrence_db_b level ϕ^{{svar:X↦level}} =
true
firstorder .
- Σ : Signature ϕ : Pattern X : svar IHϕ : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ = true
→ svar_has_negative_occurrence X ϕ = false
→ no_negative_occurrence_db_b level ϕ^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ = true
→ svar_has_positive_occurrence X ϕ = false
→ no_positive_occurrence_db_b level ϕ^{{svar:X↦level}} = true)level : db_index HnoX : no_positive_occurrence_db_b level ϕ = true Hnolevel : svar_has_positive_occurrence X ϕ = false
no_positive_occurrence_db_b level ϕ^{{svar:X↦level}} =
true
firstorder .
- Σ : Signature ϕ : Pattern X : svar IHϕ : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ = true
→ svar_has_negative_occurrence X ϕ = false
→ no_negative_occurrence_db_b level ϕ^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ = true
→ svar_has_positive_occurrence X ϕ = false
→ no_positive_occurrence_db_b level ϕ^{{svar:X↦level}} = true)level : db_index HnoX : no_negative_occurrence_db_b (S level) ϕ = true Hnolevel : svar_has_negative_occurrence X ϕ = false
no_negative_occurrence_db_b (S level)
ϕ^{{svar:X↦S level}} = true
firstorder .
- Σ : Signature ϕ : Pattern X : svar IHϕ : ∀ level : db_index,
(no_negative_occurrence_db_b level ϕ = true
→ svar_has_negative_occurrence X ϕ = false
→ no_negative_occurrence_db_b level ϕ^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ = true
→ svar_has_positive_occurrence X ϕ = false
→ no_positive_occurrence_db_b level ϕ^{{svar:X↦level}} = true)level : db_index HnoX : no_positive_occurrence_db_b (S level) ϕ = true Hnolevel : svar_has_positive_occurrence X ϕ = false
no_positive_occurrence_db_b (S level)
ϕ^{{svar:X↦S level}} = true
firstorder .
Qed .
Lemma no_negative_occurrence_svar_quantify ϕ level X :
no_negative_occurrence_db_b level ϕ = true ->
svar_has_negative_occurrence X ϕ = false ->
no_negative_occurrence_db_b level (ϕ^{{svar: X ↦ level}}) = true.Σ : Signature ϕ : Pattern level : db_index X : svar
no_negative_occurrence_db_b level ϕ = true
→ svar_has_negative_occurrence X ϕ = false
→ no_negative_occurrence_db_b level
ϕ^{{svar:X↦level}} = true
Proof .Σ : Signature ϕ : Pattern level : db_index X : svar
no_negative_occurrence_db_b level ϕ = true
→ svar_has_negative_occurrence X ϕ = false
→ no_negative_occurrence_db_b level
ϕ^{{svar:X↦level}} = true
intros H1 H2.Σ : Signature ϕ : Pattern level : db_index X : svar H1 : no_negative_occurrence_db_b level ϕ = true H2 : svar_has_negative_occurrence X ϕ = false
no_negative_occurrence_db_b level ϕ^{{svar:X↦level}} =
true
pose proof (Htmp :=Private_no_negative_occurrence_svar_quantify ϕ level X).Σ : Signature ϕ : Pattern level : db_index X : svar H1 : no_negative_occurrence_db_b level ϕ = true H2 : svar_has_negative_occurrence X ϕ = false Htmp : (no_negative_occurrence_db_b level ϕ = true
→ svar_has_negative_occurrence X ϕ = false
→ no_negative_occurrence_db_b level
ϕ^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ = true
→ svar_has_positive_occurrence X ϕ = false
→ no_positive_occurrence_db_b level
ϕ^{{svar:X↦level}} = true)
no_negative_occurrence_db_b level ϕ^{{svar:X↦level}} =
true
destruct Htmp as [Htmp1 Htmp2].Σ : Signature ϕ : Pattern level : db_index X : svar H1 : no_negative_occurrence_db_b level ϕ = true H2 : svar_has_negative_occurrence X ϕ = false Htmp1 : no_negative_occurrence_db_b level ϕ = true
→ svar_has_negative_occurrence X ϕ = false
→ no_negative_occurrence_db_b level
ϕ^{{svar:X↦level}} = true Htmp2 : no_positive_occurrence_db_b level ϕ = true
→ svar_has_positive_occurrence X ϕ = false
→ no_positive_occurrence_db_b level
ϕ^{{svar:X↦level}} = true
no_negative_occurrence_db_b level ϕ^{{svar:X↦level}} =
true
auto .
Qed .
Lemma no_positive_occurrence_svar_quantify ϕ level X :
no_positive_occurrence_db_b level ϕ = true ->
svar_has_positive_occurrence X ϕ = false ->
no_positive_occurrence_db_b level (ϕ^{{svar: X ↦ level}}) = true.Σ : Signature ϕ : Pattern level : db_index X : svar
no_positive_occurrence_db_b level ϕ = true
→ svar_has_positive_occurrence X ϕ = false
→ no_positive_occurrence_db_b level
ϕ^{{svar:X↦level}} = true
Proof .Σ : Signature ϕ : Pattern level : db_index X : svar
no_positive_occurrence_db_b level ϕ = true
→ svar_has_positive_occurrence X ϕ = false
→ no_positive_occurrence_db_b level
ϕ^{{svar:X↦level}} = true
intros H1 H2.Σ : Signature ϕ : Pattern level : db_index X : svar H1 : no_positive_occurrence_db_b level ϕ = true H2 : svar_has_positive_occurrence X ϕ = false
no_positive_occurrence_db_b level ϕ^{{svar:X↦level}} =
true
pose proof (Htmp :=Private_no_negative_occurrence_svar_quantify ϕ level X).Σ : Signature ϕ : Pattern level : db_index X : svar H1 : no_positive_occurrence_db_b level ϕ = true H2 : svar_has_positive_occurrence X ϕ = false Htmp : (no_negative_occurrence_db_b level ϕ = true
→ svar_has_negative_occurrence X ϕ = false
→ no_negative_occurrence_db_b level
ϕ^{{svar:X↦level}} = true)
∧ (no_positive_occurrence_db_b level ϕ = true
→ svar_has_positive_occurrence X ϕ = false
→ no_positive_occurrence_db_b level
ϕ^{{svar:X↦level}} = true)
no_positive_occurrence_db_b level ϕ^{{svar:X↦level}} =
true
destruct Htmp as [Htmp1 Htmp2].Σ : Signature ϕ : Pattern level : db_index X : svar H1 : no_positive_occurrence_db_b level ϕ = true H2 : svar_has_positive_occurrence X ϕ = false Htmp1 : no_negative_occurrence_db_b level ϕ = true
→ svar_has_negative_occurrence X ϕ = false
→ no_negative_occurrence_db_b level
ϕ^{{svar:X↦level}} = true Htmp2 : no_positive_occurrence_db_b level ϕ = true
→ svar_has_positive_occurrence X ϕ = false
→ no_positive_occurrence_db_b level
ϕ^{{svar:X↦level}} = true
no_positive_occurrence_db_b level ϕ^{{svar:X↦level}} =
true
auto .
Qed .
Lemma no_negative_occurrence_svar_quantify_2 X dbi1 dbi2 ϕ :
dbi1 <> dbi2 ->
no_negative_occurrence_db_b dbi1 (ϕ^{{svar: X ↦ dbi2}}) = no_negative_occurrence_db_b dbi1 ϕ
with no_positive_occurrence_svar_quantify_2 X dbi1 dbi2 ϕ:
dbi1 <> dbi2 ->
no_positive_occurrence_db_b dbi1 (ϕ^{{svar: X ↦ dbi2}}) = no_positive_occurrence_db_b dbi1 ϕ.Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar dbi1, dbi2 : db_index ϕ : Pattern
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1 ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ
Proof .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar dbi1, dbi2 : db_index ϕ : Pattern
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1 ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ
- Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar dbi1, dbi2 : db_index ϕ : Pattern
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1 ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ
move : dbi1 dbi2.Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern
∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1 ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ
induction ϕ; intros dbi1 dbi2 Hdbi; simpl ; auto .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX, x : svar dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_negative_occurrence_db_b dbi1
(if decide (X = x)
then patt_bound_svar dbi2
else patt_free_svar x) =
no_negative_occurrence_db_b dbi1 (patt_free_svar x)
+ Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX, x : svar dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_negative_occurrence_db_b dbi1
(if decide (X = x)
then patt_bound_svar dbi2
else patt_free_svar x) =
no_negative_occurrence_db_b dbi1 (patt_free_svar x)
case_match; reflexivity .
+ Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_negative_occurrence_db_b dbi1
(patt_app ϕ1^{{svar:X↦dbi2}} ϕ2^{{svar:X↦dbi2}}) =
no_negative_occurrence_db_b dbi1 (patt_app ϕ1 ϕ2)
cbn .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_negative_occurrence_db_b dbi1 ϕ1^{{svar:X↦dbi2}} &&
no_negative_occurrence_db_b dbi1 ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ1 &&
no_negative_occurrence_db_b dbi1 ϕ2
rewrite IHϕ1.Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
dbi1 ≠ dbi2
lia .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_negative_occurrence_db_b dbi1 ϕ1 &&
no_negative_occurrence_db_b dbi1 ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ1 &&
no_negative_occurrence_db_b dbi1 ϕ2
rewrite IHϕ2.Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
dbi1 ≠ dbi2
lia .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_negative_occurrence_db_b dbi1 ϕ1 &&
no_negative_occurrence_db_b dbi1 ϕ2 =
no_negative_occurrence_db_b dbi1 ϕ1 &&
no_negative_occurrence_db_b dbi1 ϕ2
reflexivity .
+ Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_negative_occurrence_db_b dbi1
(patt_imp ϕ1^{{svar:X↦dbi2}} ϕ2^{{svar:X↦dbi2}}) =
no_negative_occurrence_db_b dbi1 (patt_imp ϕ1 ϕ2)
unfold no_negative_occurrence_db_b at 1 .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 ϕ1^{{svar:X↦dbi2}} &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 (patt_imp ϕ1 ϕ2)
fold (no_positive_occurrence_db_b dbi1 (ϕ1^{{svar: X ↦ dbi2}})).Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_positive_occurrence_db_b dbi1 ϕ1^{{svar:X↦dbi2}} &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 (patt_imp ϕ1 ϕ2)
fold (no_negative_occurrence_db_b dbi1 (ϕ2^{{svar: X ↦ dbi2}})).Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_positive_occurrence_db_b dbi1 ϕ1^{{svar:X↦dbi2}} &&
no_negative_occurrence_db_b dbi1 ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 (patt_imp ϕ1 ϕ2)
rewrite no_positive_occurrence_svar_quantify_2.Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
dbi1 ≠ dbi2
lia .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_positive_occurrence_db_b dbi1 ϕ1 &&
no_negative_occurrence_db_b dbi1 ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 (patt_imp ϕ1 ϕ2)
rewrite IHϕ2.Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
dbi1 ≠ dbi2
lia .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_positive_occurrence_db_b dbi1 ϕ1 &&
no_negative_occurrence_db_b dbi1 ϕ2 =
no_negative_occurrence_db_b dbi1 (patt_imp ϕ1 ϕ2)
reflexivity .
+ Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern IHϕ : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕdbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_negative_occurrence_db_b dbi1
(patt_exists ϕ^{{svar:X↦dbi2}}) =
no_negative_occurrence_db_b dbi1 (patt_exists ϕ)
cbn .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern IHϕ : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕdbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_negative_occurrence_db_b dbi1 ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕ
rewrite IHϕ.Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern IHϕ : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕdbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
dbi1 ≠ dbi2
lia .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern IHϕ : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕdbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_negative_occurrence_db_b dbi1 ϕ =
no_negative_occurrence_db_b dbi1 ϕ
reflexivity .
+ Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern IHϕ : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕdbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_negative_occurrence_db_b dbi1
(patt_mu ϕ^{{svar:X↦S dbi2}}) =
no_negative_occurrence_db_b dbi1 (patt_mu ϕ)
cbn .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern IHϕ : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕdbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_negative_occurrence_db_b (S dbi1)
ϕ^{{svar:X↦S dbi2}} =
no_negative_occurrence_db_b (S dbi1) ϕ
rewrite IHϕ.Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern IHϕ : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕdbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
S dbi1 ≠ S dbi2
lia .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern IHϕ : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b dbi1 ϕdbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_negative_occurrence_db_b (S dbi1) ϕ =
no_negative_occurrence_db_b (S dbi1) ϕ
reflexivity .
- Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar dbi1, dbi2 : db_index ϕ : Pattern
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1 ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ
move : dbi1 dbi2.Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern
∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1 ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ
induction ϕ; intros dbi1 dbi2 Hdbi; simpl ; auto .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX, x : svar dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_positive_occurrence_db_b dbi1
(if decide (X = x)
then patt_bound_svar dbi2
else patt_free_svar x) =
no_positive_occurrence_db_b dbi1 (patt_free_svar x)
+ Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX, x : svar dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_positive_occurrence_db_b dbi1
(if decide (X = x)
then patt_bound_svar dbi2
else patt_free_svar x) =
no_positive_occurrence_db_b dbi1 (patt_free_svar x)
case_match; cbn . Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX, x : svar dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2 e : X = x H : decide (X = x) = left e
(if decide (dbi2 = dbi1) then false else true) = true
2 : reflexivity .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX, x : svar dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2 e : X = x H : decide (X = x) = left e
(if decide (dbi2 = dbi1) then false else true) = true
case_match; congruence .
+ Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_positive_occurrence_db_b dbi1
(patt_app ϕ1^{{svar:X↦dbi2}} ϕ2^{{svar:X↦dbi2}}) =
no_positive_occurrence_db_b dbi1 (patt_app ϕ1 ϕ2)
cbn .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_positive_occurrence_db_b dbi1 ϕ1^{{svar:X↦dbi2}} &&
no_positive_occurrence_db_b dbi1 ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ1 &&
no_positive_occurrence_db_b dbi1 ϕ2
rewrite IHϕ1.Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
dbi1 ≠ dbi2
lia .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_positive_occurrence_db_b dbi1 ϕ1 &&
no_positive_occurrence_db_b dbi1 ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ1 &&
no_positive_occurrence_db_b dbi1 ϕ2
rewrite IHϕ2.Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
dbi1 ≠ dbi2
lia .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_positive_occurrence_db_b dbi1 ϕ1 &&
no_positive_occurrence_db_b dbi1 ϕ2 =
no_positive_occurrence_db_b dbi1 ϕ1 &&
no_positive_occurrence_db_b dbi1 ϕ2
reflexivity .
+ Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_positive_occurrence_db_b dbi1
(patt_imp ϕ1^{{svar:X↦dbi2}} ϕ2^{{svar:X↦dbi2}}) =
no_positive_occurrence_db_b dbi1 (patt_imp ϕ1 ϕ2)
unfold no_positive_occurrence_db_b at 1 .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) dbi1 ϕ1^{{svar:X↦dbi2}} &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 (patt_imp ϕ1 ϕ2)
fold (no_negative_occurrence_db_b dbi1 (ϕ1^{{svar: X ↦ dbi2}})).Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_negative_occurrence_db_b dbi1 ϕ1^{{svar:X↦dbi2}} &&
(fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) dbi1 ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 (patt_imp ϕ1 ϕ2)
fold (no_positive_occurrence_db_b dbi1 (ϕ2^{{svar: X ↦ dbi2}})).Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_negative_occurrence_db_b dbi1 ϕ1^{{svar:X↦dbi2}} &&
no_positive_occurrence_db_b dbi1 ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 (patt_imp ϕ1 ϕ2)
rewrite no_negative_occurrence_svar_quantify_2.Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
dbi1 ≠ dbi2
lia .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_negative_occurrence_db_b dbi1 ϕ1 &&
no_positive_occurrence_db_b dbi1 ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 (patt_imp ϕ1 ϕ2)
rewrite IHϕ2.Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
dbi1 ≠ dbi2
lia .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ1, ϕ2 : Pattern IHϕ1 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ1^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ1IHϕ2 : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ2^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ2dbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_negative_occurrence_db_b dbi1 ϕ1 &&
no_positive_occurrence_db_b dbi1 ϕ2 =
no_positive_occurrence_db_b dbi1 (patt_imp ϕ1 ϕ2)
reflexivity .
+ Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern IHϕ : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕdbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_positive_occurrence_db_b dbi1
(patt_exists ϕ^{{svar:X↦dbi2}}) =
no_positive_occurrence_db_b dbi1 (patt_exists ϕ)
cbn .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern IHϕ : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕdbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_positive_occurrence_db_b dbi1 ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕ
rewrite IHϕ.Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern IHϕ : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕdbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
dbi1 ≠ dbi2
lia .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern IHϕ : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕdbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_positive_occurrence_db_b dbi1 ϕ =
no_positive_occurrence_db_b dbi1 ϕ
reflexivity .
+ Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern IHϕ : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕdbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_positive_occurrence_db_b dbi1
(patt_mu ϕ^{{svar:X↦S dbi2}}) =
no_positive_occurrence_db_b dbi1 (patt_mu ϕ)
cbn .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern IHϕ : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕdbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_positive_occurrence_db_b (S dbi1)
ϕ^{{svar:X↦S dbi2}} =
no_positive_occurrence_db_b (S dbi1) ϕ
rewrite IHϕ.Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern IHϕ : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕdbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
S dbi1 ≠ S dbi2
lia .Σ : Signature no_negative_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_negative_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_negative_occurrence_db_b
dbi1 ϕno_positive_occurrence_svar_quantify_2 : ∀ (X : svar)
(dbi1
dbi2 : db_index)
(ϕ : Pattern),
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b
dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b
dbi1 ϕX : svar ϕ : Pattern IHϕ : ∀ dbi1 dbi2 : db_index,
dbi1 ≠ dbi2
→ no_positive_occurrence_db_b dbi1
ϕ^{{svar:X↦dbi2}} =
no_positive_occurrence_db_b dbi1 ϕdbi1, dbi2 : db_index Hdbi : dbi1 ≠ dbi2
no_positive_occurrence_db_b (S dbi1) ϕ =
no_positive_occurrence_db_b (S dbi1) ϕ
reflexivity .
Qed .
Lemma well_formed_positive_svar_quantify X dbi ϕ :
well_formed_positive ϕ ->
well_formed_positive (ϕ^{{svar: X ↦ dbi}}) = true.Σ : Signature X : svar dbi : db_index ϕ : Pattern
well_formed_positive ϕ
→ well_formed_positive ϕ^{{svar:X↦dbi}} = true
Proof .Σ : Signature X : svar dbi : db_index ϕ : Pattern
well_formed_positive ϕ
→ well_formed_positive ϕ^{{svar:X↦dbi}} = true
intros Hϕ.Σ : Signature X : svar dbi : db_index ϕ : Pattern Hϕ : well_formed_positive ϕ
well_formed_positive ϕ^{{svar:X↦dbi}} = true
move : dbi.Σ : Signature X : svar ϕ : Pattern Hϕ : well_formed_positive ϕ
∀ dbi : db_index,
well_formed_positive ϕ^{{svar:X↦dbi}} = true
induction ϕ; intros dbi; simpl ; auto .Σ : Signature X, x : svar Hϕ : well_formed_positive (patt_free_svar x) dbi : db_index
well_formed_positive
(if decide (X = x)
then patt_bound_svar dbi
else patt_free_svar x) = true
- Σ : Signature X, x : svar Hϕ : well_formed_positive (patt_free_svar x) dbi : db_index
well_formed_positive
(if decide (X = x)
then patt_bound_svar dbi
else patt_free_svar x) = true
case_match; reflexivity .
- Σ : Signature X : svar ϕ1, ϕ2 : Pattern Hϕ : well_formed_positive (patt_app ϕ1 ϕ2) IHϕ1 : well_formed_positive ϕ1
→ ∀ dbi : db_index,
well_formed_positive ϕ1^{{svar:X↦dbi}} =
true IHϕ2 : well_formed_positive ϕ2
→ ∀ dbi : db_index,
well_formed_positive ϕ2^{{svar:X↦dbi}} =
true dbi : db_index
well_formed_positive ϕ1^{{svar:X↦dbi}} &&
well_formed_positive ϕ2^{{svar:X↦dbi}} = true
simpl in Hϕ.Σ : Signature X : svar ϕ1, ϕ2 : Pattern Hϕ : well_formed_positive ϕ1 &&
well_formed_positive ϕ2 IHϕ1 : well_formed_positive ϕ1
→ ∀ dbi : db_index,
well_formed_positive ϕ1^{{svar:X↦dbi}} =
true IHϕ2 : well_formed_positive ϕ2
→ ∀ dbi : db_index,
well_formed_positive ϕ2^{{svar:X↦dbi}} =
true dbi : db_index
well_formed_positive ϕ1^{{svar:X↦dbi}} &&
well_formed_positive ϕ2^{{svar:X↦dbi}} = true
destruct_and!. Σ : Signature X : svar ϕ1, ϕ2 : Pattern H : well_formed_positive ϕ1 = true H0 : well_formed_positive ϕ2 = true IHϕ1 : well_formed_positive ϕ1
→ ∀ dbi : db_index,
well_formed_positive ϕ1^{{svar:X↦dbi}} =
true IHϕ2 : well_formed_positive ϕ2
→ ∀ dbi : db_index,
well_formed_positive ϕ2^{{svar:X↦dbi}} =
true dbi : db_index
well_formed_positive ϕ1^{{svar:X↦dbi}} &&
well_formed_positive ϕ2^{{svar:X↦dbi}} = true
specialize (IHϕ1 ltac :(assumption )).Σ : Signature X : svar ϕ1, ϕ2 : Pattern H : well_formed_positive ϕ1 = true H0 : well_formed_positive ϕ2 = true IHϕ1 : ∀ dbi : db_index,
well_formed_positive ϕ1^{{svar:X↦dbi}} = trueIHϕ2 : well_formed_positive ϕ2
→ ∀ dbi : db_index,
well_formed_positive ϕ2^{{svar:X↦dbi}} =
true dbi : db_index
well_formed_positive ϕ1^{{svar:X↦dbi}} &&
well_formed_positive ϕ2^{{svar:X↦dbi}} = true
specialize (IHϕ2 ltac :(assumption )).Σ : Signature X : svar ϕ1, ϕ2 : Pattern H : well_formed_positive ϕ1 = true H0 : well_formed_positive ϕ2 = true IHϕ1 : ∀ dbi : db_index,
well_formed_positive ϕ1^{{svar:X↦dbi}} = trueIHϕ2 : ∀ dbi : db_index,
well_formed_positive ϕ2^{{svar:X↦dbi}} = truedbi : db_index
well_formed_positive ϕ1^{{svar:X↦dbi}} &&
well_formed_positive ϕ2^{{svar:X↦dbi}} = true
rewrite IHϕ1.Σ : Signature X : svar ϕ1, ϕ2 : Pattern H : well_formed_positive ϕ1 = true H0 : well_formed_positive ϕ2 = true IHϕ1 : ∀ dbi : db_index,
well_formed_positive ϕ1^{{svar:X↦dbi}} = trueIHϕ2 : ∀ dbi : db_index,
well_formed_positive ϕ2^{{svar:X↦dbi}} = truedbi : db_index
true && well_formed_positive ϕ2^{{svar:X↦dbi}} = true
rewrite IHϕ2.Σ : Signature X : svar ϕ1, ϕ2 : Pattern H : well_formed_positive ϕ1 = true H0 : well_formed_positive ϕ2 = true IHϕ1 : ∀ dbi : db_index,
well_formed_positive ϕ1^{{svar:X↦dbi}} = trueIHϕ2 : ∀ dbi : db_index,
well_formed_positive ϕ2^{{svar:X↦dbi}} = truedbi : db_index
true && true = true
reflexivity .
- Σ : Signature X : svar ϕ1, ϕ2 : Pattern Hϕ : well_formed_positive (patt_imp ϕ1 ϕ2) IHϕ1 : well_formed_positive ϕ1
→ ∀ dbi : db_index,
well_formed_positive ϕ1^{{svar:X↦dbi}} =
true IHϕ2 : well_formed_positive ϕ2
→ ∀ dbi : db_index,
well_formed_positive ϕ2^{{svar:X↦dbi}} =
true dbi : db_index
well_formed_positive ϕ1^{{svar:X↦dbi}} &&
well_formed_positive ϕ2^{{svar:X↦dbi}} = true
simpl in Hϕ.Σ : Signature X : svar ϕ1, ϕ2 : Pattern Hϕ : well_formed_positive ϕ1 &&
well_formed_positive ϕ2 IHϕ1 : well_formed_positive ϕ1
→ ∀ dbi : db_index,
well_formed_positive ϕ1^{{svar:X↦dbi}} =
true IHϕ2 : well_formed_positive ϕ2
→ ∀ dbi : db_index,
well_formed_positive ϕ2^{{svar:X↦dbi}} =
true dbi : db_index
well_formed_positive ϕ1^{{svar:X↦dbi}} &&
well_formed_positive ϕ2^{{svar:X↦dbi}} = true
destruct_and!. Σ : Signature X : svar ϕ1, ϕ2 : Pattern H : well_formed_positive ϕ1 = true H0 : well_formed_positive ϕ2 = true IHϕ1 : well_formed_positive ϕ1
→ ∀ dbi : db_index,
well_formed_positive ϕ1^{{svar:X↦dbi}} =
true IHϕ2 : well_formed_positive ϕ2
→ ∀ dbi : db_index,
well_formed_positive ϕ2^{{svar:X↦dbi}} =
true dbi : db_index
well_formed_positive ϕ1^{{svar:X↦dbi}} &&
well_formed_positive ϕ2^{{svar:X↦dbi}} = true
specialize (IHϕ1 ltac :(assumption )).Σ : Signature X : svar ϕ1, ϕ2 : Pattern H : well_formed_positive ϕ1 = true H0 : well_formed_positive ϕ2 = true IHϕ1 : ∀ dbi : db_index,
well_formed_positive ϕ1^{{svar:X↦dbi}} = trueIHϕ2 : well_formed_positive ϕ2
→ ∀ dbi : db_index,
well_formed_positive ϕ2^{{svar:X↦dbi}} =
true dbi : db_index
well_formed_positive ϕ1^{{svar:X↦dbi}} &&
well_formed_positive ϕ2^{{svar:X↦dbi}} = true
specialize (IHϕ2 ltac :(assumption )).Σ : Signature X : svar ϕ1, ϕ2 : Pattern H : well_formed_positive ϕ1 = true H0 : well_formed_positive ϕ2 = true IHϕ1 : ∀ dbi : db_index,
well_formed_positive ϕ1^{{svar:X↦dbi}} = trueIHϕ2 : ∀ dbi : db_index,
well_formed_positive ϕ2^{{svar:X↦dbi}} = truedbi : db_index
well_formed_positive ϕ1^{{svar:X↦dbi}} &&
well_formed_positive ϕ2^{{svar:X↦dbi}} = true
rewrite IHϕ1.Σ : Signature X : svar ϕ1, ϕ2 : Pattern H : well_formed_positive ϕ1 = true H0 : well_formed_positive ϕ2 = true IHϕ1 : ∀ dbi : db_index,
well_formed_positive ϕ1^{{svar:X↦dbi}} = trueIHϕ2 : ∀ dbi : db_index,
well_formed_positive ϕ2^{{svar:X↦dbi}} = truedbi : db_index
true && well_formed_positive ϕ2^{{svar:X↦dbi}} = true
rewrite IHϕ2.Σ : Signature X : svar ϕ1, ϕ2 : Pattern H : well_formed_positive ϕ1 = true H0 : well_formed_positive ϕ2 = true IHϕ1 : ∀ dbi : db_index,
well_formed_positive ϕ1^{{svar:X↦dbi}} = trueIHϕ2 : ∀ dbi : db_index,
well_formed_positive ϕ2^{{svar:X↦dbi}} = truedbi : db_index
true && true = true
reflexivity .
- Σ : Signature X : svar ϕ : Pattern Hϕ : well_formed_positive (patt_mu ϕ) IHϕ : well_formed_positive ϕ
→ ∀ dbi : db_index, well_formed_positive ϕ^{{svar:X↦dbi}} = true dbi : db_index
no_negative_occurrence_db_b 0 ϕ^{{svar:X↦S dbi}} &&
well_formed_positive ϕ^{{svar:X↦S dbi}} = true
simpl in Hϕ.Σ : Signature X : svar ϕ : Pattern Hϕ : no_negative_occurrence_db_b 0 ϕ &&
well_formed_positive ϕ IHϕ : well_formed_positive ϕ
→ ∀ dbi : db_index, well_formed_positive ϕ^{{svar:X↦dbi}} = true dbi : db_index
no_negative_occurrence_db_b 0 ϕ^{{svar:X↦S dbi}} &&
well_formed_positive ϕ^{{svar:X↦S dbi}} = true
destruct_and!. Σ : Signature X : svar ϕ : Pattern H : no_negative_occurrence_db_b 0 ϕ = true H0 : well_formed_positive ϕ = true IHϕ : well_formed_positive ϕ
→ ∀ dbi : db_index, well_formed_positive ϕ^{{svar:X↦dbi}} = true dbi : db_index
no_negative_occurrence_db_b 0 ϕ^{{svar:X↦S dbi}} &&
well_formed_positive ϕ^{{svar:X↦S dbi}} = true
specialize (IHϕ ltac :(assumption )).Σ : Signature X : svar ϕ : Pattern H : no_negative_occurrence_db_b 0 ϕ = true H0 : well_formed_positive ϕ = true IHϕ : ∀ dbi : db_index, well_formed_positive ϕ^{{svar:X↦dbi}} = truedbi : db_index
no_negative_occurrence_db_b 0 ϕ^{{svar:X↦S dbi}} &&
well_formed_positive ϕ^{{svar:X↦S dbi}} = true
rewrite IHϕ.Σ : Signature X : svar ϕ : Pattern H : no_negative_occurrence_db_b 0 ϕ = true H0 : well_formed_positive ϕ = true IHϕ : ∀ dbi : db_index, well_formed_positive ϕ^{{svar:X↦dbi}} = truedbi : db_index
no_negative_occurrence_db_b 0 ϕ^{{svar:X↦S dbi}} &&
true = true
rewrite no_negative_occurrence_svar_quantify_2.Σ : Signature X : svar ϕ : Pattern H : no_negative_occurrence_db_b 0 ϕ = true H0 : well_formed_positive ϕ = true IHϕ : ∀ dbi : db_index, well_formed_positive ϕ^{{svar:X↦dbi}} = truedbi : db_index
0 ≠ S dbi
lia .Σ : Signature X : svar ϕ : Pattern H : no_negative_occurrence_db_b 0 ϕ = true H0 : well_formed_positive ϕ = true IHϕ : ∀ dbi : db_index, well_formed_positive ϕ^{{svar:X↦dbi}} = truedbi : db_index
no_negative_occurrence_db_b 0 ϕ && true = true
split_and!; auto .
Qed .
Lemma free_evar_subst_free_evar_subst φ ψ η x n :
well_formed_closed_ex_aux ψ n ->
x ∉ free_evars η ->
φ^[[evar :x ↦ ψ]]^[evar :n ↦ η] =
φ^[evar :n ↦ η]^[[evar :x ↦ ψ]].Σ : Signature φ, ψ, η : Pattern x : evar n : db_index
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η
→ φ^[[evar :x↦ψ]]^[evar :n↦η] =
φ^[evar :n↦η]^[[evar :x↦ψ]]
Proof .Σ : Signature φ, ψ, η : Pattern x : evar n : db_index
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η
→ φ^[[evar :x↦ψ]]^[evar :n↦η] =
φ^[evar :n↦η]^[[evar :x↦ψ]]
generalize dependent n.Σ : Signature φ, ψ, η : Pattern x : evar
∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η
→ φ^[[evar :x↦ψ]]^[evar :n↦η] =
φ^[evar :n↦η]^[[evar :x↦ψ]]
induction φ; intros ; simpl ; auto .Σ : Signature x0 : evar ψ, η : Pattern x : evar n : db_index H : well_formed_closed_ex_aux ψ n H0 : x ∉ free_evars η
(if decide (x = x0) then ψ else patt_free_evar x0)^[evar :n↦η] =
(if decide (x = x0) then ψ else patt_free_evar x0)
* Σ : Signature x0 : evar ψ, η : Pattern x : evar n : db_index H : well_formed_closed_ex_aux ψ n H0 : x ∉ free_evars η
(if decide (x = x0) then ψ else patt_free_evar x0)^[evar :n↦η] =
(if decide (x = x0) then ψ else patt_free_evar x0)
case_match. Σ : Signature x0 : evar ψ, η : Pattern x : evar n : db_index H : well_formed_closed_ex_aux ψ n H0 : x ∉ free_evars η e : x = x0 H1 : decide (x = x0) = left e
ψ^[evar :n↦η] = ψ
now rewrite bevar_subst_not_occur.Σ : Signature x0 : evar ψ, η : Pattern x : evar n : db_index H : well_formed_closed_ex_aux ψ n H0 : x ∉ free_evars η n0 : x ≠ x0 H1 : decide (x = x0) = right n0
(patt_free_evar x0)^[evar :n↦η] = patt_free_evar x0
now simpl .
* Σ : Signature n : db_index ψ, η : Pattern x : evar n0 : db_index H : well_formed_closed_ex_aux ψ n0 H0 : x ∉ free_evars η
match compare_nat n n0 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => η
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end =
match compare_nat n n0 with
| Nat_less _ _ _ => patt_bound_evar n
| Nat_equal _ _ _ => η
| Nat_greater _ _ _ => patt_bound_evar (Nat.pred n)
end ^[[evar :x↦ψ]]
case_match; simpl ; auto . Σ : Signature n : db_index ψ, η : Pattern x : evar n0 : db_index H : well_formed_closed_ex_aux ψ n0 H0 : x ∉ free_evars η e : n = n0 H1 : compare_nat n n0 = Nat_equal n n0 e
η = η^[[evar :x↦ψ]]
now rewrite free_evar_subst_no_occurrence.
* Σ : Signature φ1, φ2, ψ, η : Pattern x : evar IHφ1 : ∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η
→ φ1^[[evar :x↦ψ]]^[evar :n↦η] =
φ1^[evar :n↦η]^[[evar :x↦ψ]]IHφ2 : ∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η
→ φ2^[[evar :x↦ψ]]^[evar :n↦η] =
φ2^[evar :n↦η]^[[evar :x↦ψ]]n : db_index H : well_formed_closed_ex_aux ψ n H0 : x ∉ free_evars η
patt_app φ1^[[evar :x↦ψ]]^[evar :n↦η]
φ2^[[evar :x↦ψ]]^[evar :n↦η] =
patt_app φ1^[evar :n↦η]^[[evar :x↦ψ]]
φ2^[evar :n↦η]^[[evar :x↦ψ]]
erewrite IHφ1, IHφ2.Σ : Signature φ1, φ2, ψ, η : Pattern x : evar IHφ1 : ∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η
→ φ1^[[evar :x↦ψ]]^[evar :n↦η] =
φ1^[evar :n↦η]^[[evar :x↦ψ]]IHφ2 : ∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η
→ φ2^[[evar :x↦ψ]]^[evar :n↦η] =
φ2^[evar :n↦η]^[[evar :x↦ψ]]n : db_index H : well_formed_closed_ex_aux ψ n H0 : x ∉ free_evars η
patt_app φ1^[evar :n↦η]^[[evar :x↦ψ]]
φ2^[evar :n↦η]^[[evar :x↦ψ]] =
patt_app φ1^[evar :n↦η]^[[evar :x↦ψ]]
φ2^[evar :n↦η]^[[evar :x↦ψ]]
reflexivity .Σ : Signature φ1, φ2, ψ, η : Pattern x : evar IHφ1 : ∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η
→ φ1^[[evar :x↦ψ]]^[evar :n↦η] =
φ1^[evar :n↦η]^[[evar :x↦ψ]]IHφ2 : ∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η
→ φ2^[[evar :x↦ψ]]^[evar :n↦η] =
φ2^[evar :n↦η]^[[evar :x↦ψ]]n : db_index H : well_formed_closed_ex_aux ψ n H0 : x ∉ free_evars η
well_formed_closed_ex_aux ψ n
all : auto .
* Σ : Signature φ1, φ2, ψ, η : Pattern x : evar IHφ1 : ∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η
→ φ1^[[evar :x↦ψ]]^[evar :n↦η] =
φ1^[evar :n↦η]^[[evar :x↦ψ]]IHφ2 : ∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η
→ φ2^[[evar :x↦ψ]]^[evar :n↦η] =
φ2^[evar :n↦η]^[[evar :x↦ψ]]n : db_index H : well_formed_closed_ex_aux ψ n H0 : x ∉ free_evars η
patt_imp φ1^[[evar :x↦ψ]]^[evar :n↦η]
φ2^[[evar :x↦ψ]]^[evar :n↦η] =
patt_imp φ1^[evar :n↦η]^[[evar :x↦ψ]]
φ2^[evar :n↦η]^[[evar :x↦ψ]]
erewrite IHφ1, IHφ2.Σ : Signature φ1, φ2, ψ, η : Pattern x : evar IHφ1 : ∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η
→ φ1^[[evar :x↦ψ]]^[evar :n↦η] =
φ1^[evar :n↦η]^[[evar :x↦ψ]]IHφ2 : ∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η
→ φ2^[[evar :x↦ψ]]^[evar :n↦η] =
φ2^[evar :n↦η]^[[evar :x↦ψ]]n : db_index H : well_formed_closed_ex_aux ψ n H0 : x ∉ free_evars η
patt_imp φ1^[evar :n↦η]^[[evar :x↦ψ]]
φ2^[evar :n↦η]^[[evar :x↦ψ]] =
patt_imp φ1^[evar :n↦η]^[[evar :x↦ψ]]
φ2^[evar :n↦η]^[[evar :x↦ψ]]
reflexivity .Σ : Signature φ1, φ2, ψ, η : Pattern x : evar IHφ1 : ∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η
→ φ1^[[evar :x↦ψ]]^[evar :n↦η] =
φ1^[evar :n↦η]^[[evar :x↦ψ]]IHφ2 : ∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η
→ φ2^[[evar :x↦ψ]]^[evar :n↦η] =
φ2^[evar :n↦η]^[[evar :x↦ψ]]n : db_index H : well_formed_closed_ex_aux ψ n H0 : x ∉ free_evars η
well_formed_closed_ex_aux ψ n
all : auto .
* Σ : Signature φ, ψ, η : Pattern x : evar IHφ : ∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η → φ^[[evar :x↦ψ]]^[evar :n↦η] = φ^[evar :n↦η]^[[evar :x↦ψ]]n : db_index H : well_formed_closed_ex_aux ψ n H0 : x ∉ free_evars η
patt_exists φ^[[evar :x↦ψ]]^[evar :S n↦η] =
patt_exists φ^[evar :S n↦η]^[[evar :x↦ψ]]
erewrite IHφ; auto .Σ : Signature φ, ψ, η : Pattern x : evar IHφ : ∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η → φ^[[evar :x↦ψ]]^[evar :n↦η] = φ^[evar :n↦η]^[[evar :x↦ψ]]n : db_index H : well_formed_closed_ex_aux ψ n H0 : x ∉ free_evars η
well_formed_closed_ex_aux ψ (S n)
eapply well_formed_closed_ex_aux_ind.Σ : Signature φ, ψ, η : Pattern x : evar IHφ : ∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η → φ^[[evar :x↦ψ]]^[evar :n↦η] = φ^[evar :n↦η]^[[evar :x↦ψ]]n : db_index H : well_formed_closed_ex_aux ψ n H0 : x ∉ free_evars η
?ind_evar1 ≤ S n
2 : eassumption .Σ : Signature φ, ψ, η : Pattern x : evar IHφ : ∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η → φ^[[evar :x↦ψ]]^[evar :n↦η] = φ^[evar :n↦η]^[[evar :x↦ψ]]n : db_index H : well_formed_closed_ex_aux ψ n H0 : x ∉ free_evars η
n ≤ S n
lia .
* Σ : Signature φ, ψ, η : Pattern x : evar IHφ : ∀ n : db_index,
well_formed_closed_ex_aux ψ n
→ x ∉ free_evars η → φ^[[evar :x↦ψ]]^[evar :n↦η] = φ^[evar :n↦η]^[[evar :x↦ψ]]n : db_index H : well_formed_closed_ex_aux ψ n H0 : x ∉ free_evars η
patt_mu φ^[[evar :x↦ψ]]^[evar :n↦η] =
patt_mu φ^[evar :n↦η]^[[evar :x↦ψ]]
erewrite IHφ; auto .
Defined .
Lemma subst_svar_evar_svar ϕ x ψ n :
x ∉ free_evars ϕ ->
ϕ^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] = ϕ^[svar:n↦ψ].Σ : Signature ϕ : Pattern x : evar ψ : Pattern n : db_index
x ∉ free_evars ϕ
→ ϕ^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ^[svar:n↦ψ]
Proof .Σ : Signature ϕ : Pattern x : evar ψ : Pattern n : db_index
x ∉ free_evars ϕ
→ ϕ^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ^[svar:n↦ψ]
intro H.Σ : Signature ϕ : Pattern x : evar ψ : Pattern n : db_index H : x ∉ free_evars ϕ
ϕ^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ^[svar:n↦ψ]
generalize dependent n.Σ : Signature ϕ : Pattern x : evar ψ : Pattern H : x ∉ free_evars ϕ
∀ n : db_index,
ϕ^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ^[svar:n↦ψ]
induction ϕ; try reflexivity ; intro n'.Σ : Signature x0, x : evar ψ : Pattern H : x ∉ free_evars (patt_free_evar x0) n' : db_index
(patt_free_evar x0)^[svar:n'↦patt_free_evar x]^[[evar :x↦ψ]] =
(patt_free_evar x0)^[svar:n'↦ψ]
+ Σ : Signature x0, x : evar ψ : Pattern H : x ∉ free_evars (patt_free_evar x0) n' : db_index
(patt_free_evar x0)^[svar:n'↦patt_free_evar x]^[[evar :x↦ψ]] =
(patt_free_evar x0)^[svar:n'↦ψ]
cbn .Σ : Signature x0, x : evar ψ : Pattern H : x ∉ free_evars (patt_free_evar x0) n' : db_index
(if decide (x = x0) then ψ else patt_free_evar x0) =
patt_free_evar x0
destruct (decide (x = x0)).Σ : Signature x0, x : evar ψ : Pattern H : x ∉ free_evars (patt_free_evar x0) n' : db_index e : x = x0
ψ = patt_free_evar x0
- Σ : Signature x0, x : evar ψ : Pattern H : x ∉ free_evars (patt_free_evar x0) n' : db_index e : x = x0
ψ = patt_free_evar x0
set_solver.
- Σ : Signature x0, x : evar ψ : Pattern H : x ∉ free_evars (patt_free_evar x0) n' : db_index n : x ≠ x0
patt_free_evar x0 = patt_free_evar x0
reflexivity .
+ Σ : Signature n : db_index x : evar ψ : Pattern H : x ∉ free_evars (patt_bound_svar n) n' : db_index
(patt_bound_svar n)^[svar:n'↦patt_free_evar x]^[[evar :x↦ψ]] =
(patt_bound_svar n)^[svar:n'↦ψ]
simpl .Σ : Signature n : db_index x : evar ψ : Pattern H : x ∉ free_evars (patt_bound_svar n) n' : db_index
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end ^[[evar :x↦ψ]] =
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => ψ
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end
destruct compare_nat.Σ : Signature n : db_index x : evar ψ : Pattern H : x ∉ free_evars (patt_bound_svar n) n' : db_index l : n < n'
(patt_bound_svar n)^[[evar :x↦ψ]] = patt_bound_svar n
- Σ : Signature n : db_index x : evar ψ : Pattern H : x ∉ free_evars (patt_bound_svar n) n' : db_index l : n < n'
(patt_bound_svar n)^[[evar :x↦ψ]] = patt_bound_svar n
reflexivity .
- Σ : Signature n : db_index x : evar ψ : Pattern H : x ∉ free_evars (patt_bound_svar n) n' : db_index e : n = n'
(patt_free_evar x)^[[evar :x↦ψ]] = ψ
simpl .Σ : Signature n : db_index x : evar ψ : Pattern H : x ∉ free_evars (patt_bound_svar n) n' : db_index e : n = n'
(if decide (x = x) then ψ else patt_free_evar x) = ψ
destruct decide.Σ : Signature n : db_index x : evar ψ : Pattern H : x ∉ free_evars (patt_bound_svar n) n' : db_index e : n = n' e0 : x = x
ψ = ψ
* Σ : Signature n : db_index x : evar ψ : Pattern H : x ∉ free_evars (patt_bound_svar n) n' : db_index e : n = n' e0 : x = x
ψ = ψ
reflexivity .
* Σ : Signature n : db_index x : evar ψ : Pattern H : x ∉ free_evars (patt_bound_svar n) n' : db_index e : n = n' n0 : x ≠ x
patt_free_evar x = ψ
congruence .
- Σ : Signature n : db_index x : evar ψ : Pattern H : x ∉ free_evars (patt_bound_svar n) n' : db_index g : n > n'
(patt_bound_svar (Nat.pred n))^[[evar :x↦ψ]] =
patt_bound_svar (Nat.pred n)
reflexivity .
+ Σ : Signature ϕ1, ϕ2 : Pattern x : evar ψ : Pattern H : x ∉ free_evars (patt_app ϕ1 ϕ2) IHϕ1 : x ∉ free_evars ϕ1
→ ∀ n : db_index,
ϕ1^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ1^[svar:n↦ψ] IHϕ2 : x ∉ free_evars ϕ2
→ ∀ n : db_index,
ϕ2^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ2^[svar:n↦ψ] n' : db_index
(patt_app ϕ1 ϕ2)^[svar:n'↦patt_free_evar x]^[[evar :x↦ψ]] =
(patt_app ϕ1 ϕ2)^[svar:n'↦ψ]
simpl in *.Σ : Signature ϕ1, ϕ2 : Pattern x : evar ψ : Pattern H : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 IHϕ1 : x ∉ free_evars ϕ1
→ ∀ n : db_index,
ϕ1^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ1^[svar:n↦ψ] IHϕ2 : x ∉ free_evars ϕ2
→ ∀ n : db_index,
ϕ2^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ2^[svar:n↦ψ] n' : db_index
patt_app ϕ1^[svar:n'↦patt_free_evar x]^[[evar :x↦ψ]]
ϕ2^[svar:n'↦patt_free_evar x]^[[evar :x↦ψ]] =
patt_app ϕ1^[svar:n'↦ψ] ϕ2^[svar:n'↦ψ]
rewrite IHϕ1.Σ : Signature ϕ1, ϕ2 : Pattern x : evar ψ : Pattern H : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 IHϕ1 : x ∉ free_evars ϕ1
→ ∀ n : db_index,
ϕ1^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ1^[svar:n↦ψ] IHϕ2 : x ∉ free_evars ϕ2
→ ∀ n : db_index,
ϕ2^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ2^[svar:n↦ψ] n' : db_index
x ∉ free_evars ϕ1
2 : rewrite IHϕ2.Σ : Signature ϕ1, ϕ2 : Pattern x : evar ψ : Pattern H : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 IHϕ1 : x ∉ free_evars ϕ1
→ ∀ n : db_index,
ϕ1^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ1^[svar:n↦ψ] IHϕ2 : x ∉ free_evars ϕ2
→ ∀ n : db_index,
ϕ2^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ2^[svar:n↦ψ] n' : db_index
x ∉ free_evars ϕ1
1 -2 : set_solver.Σ : Signature ϕ1, ϕ2 : Pattern x : evar ψ : Pattern H : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 IHϕ1 : x ∉ free_evars ϕ1
→ ∀ n : db_index,
ϕ1^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ1^[svar:n↦ψ] IHϕ2 : x ∉ free_evars ϕ2
→ ∀ n : db_index,
ϕ2^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ2^[svar:n↦ψ] n' : db_index
patt_app ϕ1^[svar:n'↦ψ] ϕ2^[svar:n'↦ψ] =
patt_app ϕ1^[svar:n'↦ψ] ϕ2^[svar:n'↦ψ]
reflexivity .
+ Σ : Signature ϕ1, ϕ2 : Pattern x : evar ψ : Pattern H : x ∉ free_evars (patt_imp ϕ1 ϕ2) IHϕ1 : x ∉ free_evars ϕ1
→ ∀ n : db_index,
ϕ1^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ1^[svar:n↦ψ] IHϕ2 : x ∉ free_evars ϕ2
→ ∀ n : db_index,
ϕ2^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ2^[svar:n↦ψ] n' : db_index
(patt_imp ϕ1 ϕ2)^[svar:n'↦patt_free_evar x]^[[evar :x↦ψ]] =
(patt_imp ϕ1 ϕ2)^[svar:n'↦ψ]
simpl in *.Σ : Signature ϕ1, ϕ2 : Pattern x : evar ψ : Pattern H : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 IHϕ1 : x ∉ free_evars ϕ1
→ ∀ n : db_index,
ϕ1^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ1^[svar:n↦ψ] IHϕ2 : x ∉ free_evars ϕ2
→ ∀ n : db_index,
ϕ2^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ2^[svar:n↦ψ] n' : db_index
patt_imp ϕ1^[svar:n'↦patt_free_evar x]^[[evar :x↦ψ]]
ϕ2^[svar:n'↦patt_free_evar x]^[[evar :x↦ψ]] =
patt_imp ϕ1^[svar:n'↦ψ] ϕ2^[svar:n'↦ψ]
rewrite IHϕ1.Σ : Signature ϕ1, ϕ2 : Pattern x : evar ψ : Pattern H : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 IHϕ1 : x ∉ free_evars ϕ1
→ ∀ n : db_index,
ϕ1^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ1^[svar:n↦ψ] IHϕ2 : x ∉ free_evars ϕ2
→ ∀ n : db_index,
ϕ2^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ2^[svar:n↦ψ] n' : db_index
x ∉ free_evars ϕ1
2 : rewrite IHϕ2.Σ : Signature ϕ1, ϕ2 : Pattern x : evar ψ : Pattern H : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 IHϕ1 : x ∉ free_evars ϕ1
→ ∀ n : db_index,
ϕ1^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ1^[svar:n↦ψ] IHϕ2 : x ∉ free_evars ϕ2
→ ∀ n : db_index,
ϕ2^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ2^[svar:n↦ψ] n' : db_index
x ∉ free_evars ϕ1
1 -2 : set_solver.Σ : Signature ϕ1, ϕ2 : Pattern x : evar ψ : Pattern H : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 IHϕ1 : x ∉ free_evars ϕ1
→ ∀ n : db_index,
ϕ1^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ1^[svar:n↦ψ] IHϕ2 : x ∉ free_evars ϕ2
→ ∀ n : db_index,
ϕ2^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] =
ϕ2^[svar:n↦ψ] n' : db_index
patt_imp ϕ1^[svar:n'↦ψ] ϕ2^[svar:n'↦ψ] =
patt_imp ϕ1^[svar:n'↦ψ] ϕ2^[svar:n'↦ψ]
reflexivity .
+ Σ : Signature ϕ : Pattern x : evar ψ : Pattern H : x ∉ free_evars (patt_exists ϕ) IHϕ : x ∉ free_evars ϕ
→ ∀ n : db_index, ϕ^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] = ϕ^[svar:n↦ψ] n' : db_index
(patt_exists ϕ)^[svar:n'↦patt_free_evar x]^[[evar :x↦ψ]] =
(patt_exists ϕ)^[svar:n'↦ψ]
simpl in *.Σ : Signature ϕ : Pattern x : evar ψ : Pattern H : x ∉ free_evars ϕ IHϕ : x ∉ free_evars ϕ
→ ∀ n : db_index, ϕ^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] = ϕ^[svar:n↦ψ] n' : db_index
patt_exists ϕ^[svar:n'↦patt_free_evar x]^[[evar :x↦ψ]] =
patt_exists ϕ^[svar:n'↦ψ]
rewrite IHϕ.Σ : Signature ϕ : Pattern x : evar ψ : Pattern H : x ∉ free_evars ϕ IHϕ : x ∉ free_evars ϕ
→ ∀ n : db_index, ϕ^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] = ϕ^[svar:n↦ψ] n' : db_index
x ∉ free_evars ϕ
set_solver. Σ : Signature ϕ : Pattern x : evar ψ : Pattern H : x ∉ free_evars ϕ IHϕ : x ∉ free_evars ϕ
→ ∀ n : db_index, ϕ^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] = ϕ^[svar:n↦ψ] n' : db_index
patt_exists ϕ^[svar:n'↦ψ] = patt_exists ϕ^[svar:n'↦ψ]
reflexivity .
+ Σ : Signature ϕ : Pattern x : evar ψ : Pattern H : x ∉ free_evars (patt_mu ϕ) IHϕ : x ∉ free_evars ϕ
→ ∀ n : db_index, ϕ^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] = ϕ^[svar:n↦ψ] n' : db_index
(patt_mu ϕ)^[svar:n'↦patt_free_evar x]^[[evar :x↦ψ]] =
(patt_mu ϕ)^[svar:n'↦ψ]
simpl in *.Σ : Signature ϕ : Pattern x : evar ψ : Pattern H : x ∉ free_evars ϕ IHϕ : x ∉ free_evars ϕ
→ ∀ n : db_index, ϕ^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] = ϕ^[svar:n↦ψ] n' : db_index
patt_mu ϕ^[svar:S n'↦patt_free_evar x]^[[evar :x↦ψ]] =
patt_mu ϕ^[svar:S n'↦ψ]
rewrite IHϕ.Σ : Signature ϕ : Pattern x : evar ψ : Pattern H : x ∉ free_evars ϕ IHϕ : x ∉ free_evars ϕ
→ ∀ n : db_index, ϕ^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] = ϕ^[svar:n↦ψ] n' : db_index
x ∉ free_evars ϕ
set_solver. Σ : Signature ϕ : Pattern x : evar ψ : Pattern H : x ∉ free_evars ϕ IHϕ : x ∉ free_evars ϕ
→ ∀ n : db_index, ϕ^[svar:n↦patt_free_evar x]^[[evar :x↦ψ]] = ϕ^[svar:n↦ψ] n' : db_index
patt_mu ϕ^[svar:S n'↦ψ] = patt_mu ϕ^[svar:S n'↦ψ]
reflexivity .
Defined .
Lemma no_neg_svar_subst ϕ x n :
x ∉ free_evars ϕ ->
no_negative_occurrence_db_b n ϕ = true ->
~~evar_has_negative_occurrence x ϕ^[svar:n↦patt_free_evar x]
with
no_pos_svar_subst ϕ x n :
x ∉ free_evars ϕ ->
no_positive_occurrence_db_b n ϕ = true ->
~~evar_has_positive_occurrence x ϕ^[svar:n↦patt_free_evar x].Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ : Pattern x : evar n : db_index
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n ϕ = true
→ ~~
evar_has_negative_occurrence x
ϕ^[svar:n↦patt_free_evar x]
Proof .Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ : Pattern x : evar n : db_index
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n ϕ = true
→ ~~
evar_has_negative_occurrence x
ϕ^[svar:n↦patt_free_evar x]
{ Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ : Pattern x : evar n : db_index
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n ϕ = true
→ ~~
evar_has_negative_occurrence x
ϕ^[svar:n↦patt_free_evar x]
clear no_neg_svar_subst.Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ : Pattern x : evar n : db_index
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n ϕ = true
→ ~~
evar_has_negative_occurrence x
ϕ^[svar:n↦patt_free_evar x]
generalize dependent n.Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ : Pattern x : evar
∀ n : db_index,
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n ϕ = true
→ ~~
evar_has_negative_occurrence x
ϕ^[svar:n↦patt_free_evar x]
induction ϕ; intros n' H0 H; simpl in *; auto .Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]n : db_index x : evar n' : db_index H0 : x ∉ ∅ H : no_negative_occurrence_db_b n' (patt_bound_svar n) =
true
~~
evar_has_negative_occurrence x
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end
* Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]n : db_index x : evar n' : db_index H0 : x ∉ ∅ H : no_negative_occurrence_db_b n' (patt_bound_svar n) =
true
~~
evar_has_negative_occurrence x
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end
case_match; auto .
* Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_negative_occurrence_db_b n' (patt_app ϕ1 ϕ2) =
true
~~
evar_has_negative_occurrence x
(patt_app ϕ1^[svar:n'↦patt_free_evar x]
ϕ2^[svar:n'↦patt_free_evar x])
cbn .Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_negative_occurrence_db_b n' (patt_app ϕ1 ϕ2) =
true
~~
(evar_has_negative_occurrence x
ϕ1^[svar:n'↦patt_free_evar x]
|| evar_has_negative_occurrence x
ϕ2^[svar:n'↦patt_free_evar x])
cbn in H.Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_negative_occurrence_db_b n' ϕ1 &&
no_negative_occurrence_db_b n' ϕ2 = true
~~
(evar_has_negative_occurrence x
ϕ1^[svar:n'↦patt_free_evar x]
|| evar_has_negative_occurrence x
ϕ2^[svar:n'↦patt_free_evar x])
rewrite negb_orb.Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_negative_occurrence_db_b n' ϕ1 &&
no_negative_occurrence_db_b n' ϕ2 = true
~~
evar_has_negative_occurrence x
ϕ1^[svar:n'↦patt_free_evar x] &&
~~
evar_has_negative_occurrence x
ϕ2^[svar:n'↦patt_free_evar x]
unfold is_true in *.Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x] = trueϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x] = trueIHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x] = truen' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_negative_occurrence_db_b n' ϕ1 &&
no_negative_occurrence_db_b n' ϕ2 = true
~~
evar_has_negative_occurrence x
ϕ1^[svar:n'↦patt_free_evar x] &&
~~
evar_has_negative_occurrence x
ϕ2^[svar:n'↦patt_free_evar x] = true
rewrite IHϕ1; auto .Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x] = trueϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x] = trueIHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x] = truen' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_negative_occurrence_db_b n' ϕ1 &&
no_negative_occurrence_db_b n' ϕ2 = true
x ∉ free_evars ϕ1
2 : rewrite IHϕ2; auto .Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x] = trueϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x] = trueIHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x] = truen' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_negative_occurrence_db_b n' ϕ1 &&
no_negative_occurrence_db_b n' ϕ2 = true
x ∉ free_evars ϕ1
all : clear -H0; set_solver.
* Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_negative_occurrence_db_b n' (patt_imp ϕ1 ϕ2) =
true
~~
evar_has_negative_occurrence x
(patt_imp ϕ1^[svar:n'↦patt_free_evar x]
ϕ2^[svar:n'↦patt_free_evar x])
cbn .Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_negative_occurrence_db_b n' (patt_imp ϕ1 ϕ2) =
true
~~
((fix evar_has_positive_occurrence
(x : evar ) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_evar x' =>
if decide (x = x') then true else false
| patt_app ϕ₁ ϕ₂ =>
evar_has_positive_occurrence x ϕ₁
|| evar_has_positive_occurrence x ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
evar_has_negative_occurrence x ϕ₁
|| evar_has_positive_occurrence x ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
evar_has_positive_occurrence x ϕ'
| _ => false
end
with evar_has_negative_occurrence
(x : evar ) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
evar_has_negative_occurrence x ϕ₁
|| evar_has_negative_occurrence x ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
evar_has_positive_occurrence x ϕ₁
|| evar_has_negative_occurrence x ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
evar_has_negative_occurrence x ϕ'
| _ => false
end
for
evar_has_positive_occurrence) x
ϕ1^[svar:n'↦patt_free_evar x]
|| evar_has_negative_occurrence x
ϕ2^[svar:n'↦patt_free_evar x])
fold evar_has_positive_occurrence.Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_negative_occurrence_db_b n' (patt_imp ϕ1 ϕ2) =
true
~~
(evar_has_positive_occurrence x
ϕ1^[svar:n'↦patt_free_evar x]
|| evar_has_negative_occurrence x
ϕ2^[svar:n'↦patt_free_evar x])
cbn in H.Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_positive_occurrence_db_b) n' ϕ1 &&
no_negative_occurrence_db_b n' ϕ2 = true
~~
(evar_has_positive_occurrence x
ϕ1^[svar:n'↦patt_free_evar x]
|| evar_has_negative_occurrence x
ϕ2^[svar:n'↦patt_free_evar x])
fold no_positive_occurrence_db_b in H.Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_positive_occurrence_db_b n' ϕ1 &&
no_negative_occurrence_db_b n' ϕ2 = true
~~
(evar_has_positive_occurrence x
ϕ1^[svar:n'↦patt_free_evar x]
|| evar_has_negative_occurrence x
ϕ2^[svar:n'↦patt_free_evar x])
destruct_and! H. Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H1 : no_positive_occurrence_db_b n' ϕ1 = true H2 : no_negative_occurrence_db_b n' ϕ2 = true
~~
(evar_has_positive_occurrence x
ϕ1^[svar:n'↦patt_free_evar x]
|| evar_has_negative_occurrence x
ϕ2^[svar:n'↦patt_free_evar x])
rewrite negb_orb.Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H1 : no_positive_occurrence_db_b n' ϕ1 = true H2 : no_negative_occurrence_db_b n' ϕ2 = true
~~
evar_has_positive_occurrence x
ϕ1^[svar:n'↦patt_free_evar x] &&
~~
evar_has_negative_occurrence x
ϕ2^[svar:n'↦patt_free_evar x]
unfold is_true in *.Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x] = trueϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x] = trueIHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x] = truen' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H1 : no_positive_occurrence_db_b n' ϕ1 = true H2 : no_negative_occurrence_db_b n' ϕ2 = true
~~
evar_has_positive_occurrence x
ϕ1^[svar:n'↦patt_free_evar x] &&
~~
evar_has_negative_occurrence x
ϕ2^[svar:n'↦patt_free_evar x] = true
rewrite IHϕ2; auto .Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x] = trueϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x] = trueIHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x] = truen' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H1 : no_positive_occurrence_db_b n' ϕ1 = true H2 : no_negative_occurrence_db_b n' ϕ2 = true
x ∉ free_evars ϕ2
clear -H0.Σ : Signature ϕ1, ϕ2 : Pattern x : evar H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2
x ∉ free_evars ϕ2
set_solver. Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x] = trueϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x] = trueIHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x] = truen' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H1 : no_positive_occurrence_db_b n' ϕ1 = true H2 : no_negative_occurrence_db_b n' ϕ2 = true
~~
evar_has_positive_occurrence x
ϕ1^[svar:n'↦patt_free_evar x] && true = true
rewrite no_pos_svar_subst; auto .Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x] = trueϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_negative_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_negative_occurrence x
ϕ1^[svar:n↦
patt_free_evar x] = trueIHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_negative_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_negative_occurrence x
ϕ2^[svar:n↦
patt_free_evar x] = truen' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H1 : no_positive_occurrence_db_b n' ϕ1 = true H2 : no_negative_occurrence_db_b n' ϕ2 = true
x ∉ free_evars ϕ1
clear -H0.Σ : Signature ϕ1, ϕ2 : Pattern x : evar H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2
x ∉ free_evars ϕ1
set_solver.
* Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ : Pattern x : evar IHϕ : ∀ n : db_index,
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n ϕ = true
→ ~~
evar_has_negative_occurrence x
ϕ^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ H : no_negative_occurrence_db_b n' (patt_exists ϕ) =
true
~~
evar_has_negative_occurrence x
(patt_exists ϕ^[svar:n'↦patt_free_evar x])
cbn in *.Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ : Pattern x : evar IHϕ : ∀ n : db_index,
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n ϕ = true
→ ~~
evar_has_negative_occurrence x
ϕ^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ H : no_negative_occurrence_db_b n' ϕ = true
~~
evar_has_negative_occurrence x
ϕ^[svar:n'↦patt_free_evar x]
now apply IHϕ.
* Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ : Pattern x : evar IHϕ : ∀ n : db_index,
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n ϕ = true
→ ~~
evar_has_negative_occurrence x
ϕ^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ H : no_negative_occurrence_db_b n' (patt_mu ϕ) = true
~~
evar_has_negative_occurrence x
(patt_mu ϕ^[svar:S n'↦patt_free_evar x])
cbn in *.Σ : Signature no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ : Pattern x : evar IHϕ : ∀ n : db_index,
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n ϕ = true
→ ~~
evar_has_negative_occurrence x
ϕ^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ H : no_negative_occurrence_db_b (S n') ϕ = true
~~
evar_has_negative_occurrence x
ϕ^[svar:S n'↦patt_free_evar x]
now apply IHϕ.
} Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ : Pattern x : evar n : db_index
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n ϕ = true
→ ~~
evar_has_positive_occurrence x
ϕ^[svar:n↦patt_free_evar x]
{ Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]no_pos_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n
ϕ = true
→ ~~
evar_has_positive_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ : Pattern x : evar n : db_index
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n ϕ = true
→ ~~
evar_has_positive_occurrence x
ϕ^[svar:n↦patt_free_evar x]
clear no_pos_svar_subst.Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ : Pattern x : evar n : db_index
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n ϕ = true
→ ~~
evar_has_positive_occurrence x
ϕ^[svar:n↦patt_free_evar x]
generalize dependent n.Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ : Pattern x : evar
∀ n : db_index,
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n ϕ = true
→ ~~
evar_has_positive_occurrence x
ϕ^[svar:n↦patt_free_evar x]
induction ϕ; intros n' H0 H; simpl in *; auto .Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]x0, x : evar n' : db_index H0 : x ∉ {[x0]} H : no_positive_occurrence_db_b n' (patt_free_evar x0) =
true
~~ evar_has_positive_occurrence x (patt_free_evar x0)
* Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]x0, x : evar n' : db_index H0 : x ∉ {[x0]} H : no_positive_occurrence_db_b n' (patt_free_evar x0) =
true
~~ evar_has_positive_occurrence x (patt_free_evar x0)
cbn .Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]x0, x : evar n' : db_index H0 : x ∉ {[x0]} H : no_positive_occurrence_db_b n' (patt_free_evar x0) =
true
~~ (if decide (x = x0) then true else false)
case_match; auto . Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]x0, x : evar n' : db_index H0 : x ∉ {[x0]} H : no_positive_occurrence_db_b n' (patt_free_evar x0) =
true e : x = x0 H1 : decide (x = x0) = left e
~~ true
set_solver.
* Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]n : db_index x : evar n' : db_index H0 : x ∉ ∅ H : no_positive_occurrence_db_b n' (patt_bound_svar n) =
true
~~
evar_has_positive_occurrence x
match compare_nat n n' with
| Nat_less _ _ _ => patt_bound_svar n
| Nat_equal _ _ _ => patt_free_evar x
| Nat_greater _ _ _ => patt_bound_svar (Nat.pred n)
end
case_match; auto . Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]n : db_index x : evar n' : db_index H0 : x ∉ ∅ H : no_positive_occurrence_db_b n' (patt_bound_svar n) =
true e : n = n' H1 : compare_nat n n' = Nat_equal n n' e
~~ evar_has_positive_occurrence x (patt_free_evar x)
cbn in *.Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]n : db_index x : evar n' : db_index H0 : x ∉ ∅ H : (if decide (n = n') then false else true) = true e : n = n' H1 : compare_nat n n' = Nat_equal n n' e
~~ (if decide (x = x) then true else false)
subst .Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]x : evar n' : db_index H0 : x ∉ ∅ H : (if decide (n' = n') then false else true) = true H1 : compare_nat n' n' = Nat_equal n' n' (erefl n')
~~ (if decide (x = x) then true else false)
destruct (decide (n' = n')); congruence .
* Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_positive_occurrence_db_b n' (patt_app ϕ1 ϕ2) =
true
~~
evar_has_positive_occurrence x
(patt_app ϕ1^[svar:n'↦patt_free_evar x]
ϕ2^[svar:n'↦patt_free_evar x])
cbn in H.Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_positive_occurrence_db_b n' ϕ1 &&
no_positive_occurrence_db_b n' ϕ2 = true
~~
evar_has_positive_occurrence x
(patt_app ϕ1^[svar:n'↦patt_free_evar x]
ϕ2^[svar:n'↦patt_free_evar x])
rewrite negb_orb.Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_positive_occurrence_db_b n' ϕ1 &&
no_positive_occurrence_db_b n' ϕ2 = true
~~
(fix evar_has_positive_occurrence
(x : evar ) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_evar x' =>
if decide (x = x') then true else false
| patt_app ϕ₁ ϕ₂ =>
evar_has_positive_occurrence x ϕ₁
|| evar_has_positive_occurrence x ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
evar_has_negative_occurrence x ϕ₁
|| evar_has_positive_occurrence x ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
evar_has_positive_occurrence x ϕ'
| _ => false
end
with evar_has_negative_occurrence
(x : evar ) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
evar_has_negative_occurrence x ϕ₁
|| evar_has_negative_occurrence x ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
evar_has_positive_occurrence x ϕ₁
|| evar_has_negative_occurrence x ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
evar_has_negative_occurrence x ϕ'
| _ => false
end
for
evar_has_positive_occurrence) x
ϕ1^[svar:n'↦patt_free_evar x] &&
~~
(fix evar_has_positive_occurrence
(x : evar ) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_evar x' =>
if decide (x = x') then true else false
| patt_app ϕ₁ ϕ₂ =>
evar_has_positive_occurrence x ϕ₁
|| evar_has_positive_occurrence x ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
evar_has_negative_occurrence x ϕ₁
|| evar_has_positive_occurrence x ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
evar_has_positive_occurrence x ϕ'
| _ => false
end
with evar_has_negative_occurrence
(x : evar ) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
evar_has_negative_occurrence x ϕ₁
|| evar_has_negative_occurrence x ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
evar_has_positive_occurrence x ϕ₁
|| evar_has_negative_occurrence x ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
evar_has_negative_occurrence x ϕ'
| _ => false
end
for
evar_has_positive_occurrence) x
ϕ2^[svar:n'↦patt_free_evar x]
fold evar_has_positive_occurrence.Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_positive_occurrence_db_b n' ϕ1 &&
no_positive_occurrence_db_b n' ϕ2 = true
~~
evar_has_positive_occurrence x
ϕ1^[svar:n'↦patt_free_evar x] &&
~~
evar_has_positive_occurrence x
ϕ2^[svar:n'↦patt_free_evar x]
unfold is_true in *.Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x] = trueϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x] = trueIHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x] = truen' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_positive_occurrence_db_b n' ϕ1 &&
no_positive_occurrence_db_b n' ϕ2 = true
~~
evar_has_positive_occurrence x
ϕ1^[svar:n'↦patt_free_evar x] &&
~~
evar_has_positive_occurrence x
ϕ2^[svar:n'↦patt_free_evar x] = true
rewrite IHϕ1; auto .Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x] = trueϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x] = trueIHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x] = truen' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_positive_occurrence_db_b n' ϕ1 &&
no_positive_occurrence_db_b n' ϕ2 = true
x ∉ free_evars ϕ1
2 : rewrite IHϕ2; auto .Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x] = trueϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x] = trueIHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x] = truen' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_positive_occurrence_db_b n' ϕ1 &&
no_positive_occurrence_db_b n' ϕ2 = true
x ∉ free_evars ϕ1
all : clear -H0; set_solver.
* Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_positive_occurrence_db_b n' (patt_imp ϕ1 ϕ2) =
true
~~
evar_has_positive_occurrence x
(patt_imp ϕ1^[svar:n'↦patt_free_evar x]
ϕ2^[svar:n'↦patt_free_evar x])
cbn .Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_positive_occurrence_db_b n' (patt_imp ϕ1 ϕ2) =
true
~~
((fix evar_has_positive_occurrence
(x : evar ) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_free_evar x' =>
if decide (x = x') then true else false
| patt_app ϕ₁ ϕ₂ =>
evar_has_positive_occurrence x ϕ₁
|| evar_has_positive_occurrence x ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
evar_has_negative_occurrence x ϕ₁
|| evar_has_positive_occurrence x ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
evar_has_positive_occurrence x ϕ'
| _ => false
end
with evar_has_negative_occurrence
(x : evar ) (ϕ : Pattern) {struct ϕ} : bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
evar_has_negative_occurrence x ϕ₁
|| evar_has_negative_occurrence x ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
evar_has_positive_occurrence x ϕ₁
|| evar_has_negative_occurrence x ϕ₂
| patt_exists ϕ' | patt_mu ϕ' =>
evar_has_negative_occurrence x ϕ'
| _ => false
end
for
evar_has_negative_occurrence) x
ϕ1^[svar:n'↦patt_free_evar x]
|| evar_has_positive_occurrence x
ϕ2^[svar:n'↦patt_free_evar x])
fold evar_has_negative_occurrence.Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_positive_occurrence_db_b n' (patt_imp ϕ1 ϕ2) =
true
~~
(evar_has_negative_occurrence x
ϕ1^[svar:n'↦patt_free_evar x]
|| evar_has_positive_occurrence x
ϕ2^[svar:n'↦patt_free_evar x])
cbn in H.Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : (fix no_negative_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_app ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_negative_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_negative_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_negative_occurrence_db_b (S dbi) ϕ'
| _ => true
end
with no_positive_occurrence_db_b
(dbi : db_index) (ϕ : Pattern) {struct ϕ} :
bool :=
match ϕ with
| patt_bound_svar n =>
if decide (n = dbi) then false else true
| patt_app ϕ₁ ϕ₂ =>
no_positive_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_imp ϕ₁ ϕ₂ =>
no_negative_occurrence_db_b dbi ϕ₁ &&
no_positive_occurrence_db_b dbi ϕ₂
| patt_exists ϕ' =>
no_positive_occurrence_db_b dbi ϕ'
| patt_mu ϕ' =>
no_positive_occurrence_db_b (S dbi) ϕ'
| _ => true
end
for
no_negative_occurrence_db_b) n' ϕ1 &&
no_positive_occurrence_db_b n' ϕ2 = true
~~
(evar_has_negative_occurrence x
ϕ1^[svar:n'↦patt_free_evar x]
|| evar_has_positive_occurrence x
ϕ2^[svar:n'↦patt_free_evar x])
fold no_negative_occurrence_db_b in H.Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H : no_negative_occurrence_db_b n' ϕ1 &&
no_positive_occurrence_db_b n' ϕ2 = true
~~
(evar_has_negative_occurrence x
ϕ1^[svar:n'↦patt_free_evar x]
|| evar_has_positive_occurrence x
ϕ2^[svar:n'↦patt_free_evar x])
destruct_and! H. Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H1 : no_negative_occurrence_db_b n' ϕ1 = true H2 : no_positive_occurrence_db_b n' ϕ2 = true
~~
(evar_has_negative_occurrence x
ϕ1^[svar:n'↦patt_free_evar x]
|| evar_has_positive_occurrence x
ϕ2^[svar:n'↦patt_free_evar x])
rewrite negb_orb.Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x]IHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H1 : no_negative_occurrence_db_b n' ϕ1 = true H2 : no_positive_occurrence_db_b n' ϕ2 = true
~~
evar_has_negative_occurrence x
ϕ1^[svar:n'↦patt_free_evar x] &&
~~
evar_has_positive_occurrence x
ϕ2^[svar:n'↦patt_free_evar x]
unfold is_true in *.Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x] = trueϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x] = trueIHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x] = truen' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H1 : no_negative_occurrence_db_b n' ϕ1 = true H2 : no_positive_occurrence_db_b n' ϕ2 = true
~~
evar_has_negative_occurrence x
ϕ1^[svar:n'↦patt_free_evar x] &&
~~
evar_has_positive_occurrence x
ϕ2^[svar:n'↦patt_free_evar x] = true
rewrite IHϕ2; auto .Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x] = trueϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x] = trueIHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x] = truen' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H1 : no_negative_occurrence_db_b n' ϕ1 = true H2 : no_positive_occurrence_db_b n' ϕ2 = true
x ∉ free_evars ϕ2
clear -H0.Σ : Signature ϕ1, ϕ2 : Pattern x : evar H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2
x ∉ free_evars ϕ2
set_solver. Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x] = trueϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x] = trueIHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x] = truen' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H1 : no_negative_occurrence_db_b n' ϕ1 = true H2 : no_positive_occurrence_db_b n' ϕ2 = true
~~
evar_has_negative_occurrence x
ϕ1^[svar:n'↦patt_free_evar x] && true = true
rewrite no_neg_svar_subst; auto .Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x] = trueϕ1, ϕ2 : Pattern x : evar IHϕ1 : ∀ n : db_index,
x ∉ free_evars ϕ1
→ no_positive_occurrence_db_b n ϕ1 = true
→ ~~
evar_has_positive_occurrence x
ϕ1^[svar:n↦
patt_free_evar x] = trueIHϕ2 : ∀ n : db_index,
x ∉ free_evars ϕ2
→ no_positive_occurrence_db_b n ϕ2 = true
→ ~~
evar_has_positive_occurrence x
ϕ2^[svar:n↦
patt_free_evar x] = truen' : db_index H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2 H1 : no_negative_occurrence_db_b n' ϕ1 = true H2 : no_positive_occurrence_db_b n' ϕ2 = true
x ∉ free_evars ϕ1
clear -H0.Σ : Signature ϕ1, ϕ2 : Pattern x : evar H0 : x ∉ free_evars ϕ1 ∪ free_evars ϕ2
x ∉ free_evars ϕ1
set_solver.
* Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ : Pattern x : evar IHϕ : ∀ n : db_index,
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n ϕ = true
→ ~~
evar_has_positive_occurrence x
ϕ^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ H : no_positive_occurrence_db_b n' (patt_exists ϕ) =
true
~~
evar_has_positive_occurrence x
(patt_exists ϕ^[svar:n'↦patt_free_evar x])
cbn in *.Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ : Pattern x : evar IHϕ : ∀ n : db_index,
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n ϕ = true
→ ~~
evar_has_positive_occurrence x
ϕ^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ H : no_positive_occurrence_db_b n' ϕ = true
~~
evar_has_positive_occurrence x
ϕ^[svar:n'↦patt_free_evar x]
now apply IHϕ.
* Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ : Pattern x : evar IHϕ : ∀ n : db_index,
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n ϕ = true
→ ~~
evar_has_positive_occurrence x
ϕ^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ H : no_positive_occurrence_db_b n' (patt_mu ϕ) = true
~~
evar_has_positive_occurrence x
(patt_mu ϕ^[svar:S n'↦patt_free_evar x])
cbn in *.Σ : Signature no_neg_svar_subst : ∀ (ϕ : Pattern) (x : evar )
(n : db_index),
x ∉ free_evars ϕ
→ no_negative_occurrence_db_b n
ϕ = true
→ ~~
evar_has_negative_occurrence
x
ϕ^[svar:n↦
patt_free_evar x]ϕ : Pattern x : evar IHϕ : ∀ n : db_index,
x ∉ free_evars ϕ
→ no_positive_occurrence_db_b n ϕ = true
→ ~~
evar_has_positive_occurrence x
ϕ^[svar:n↦
patt_free_evar x]n' : db_index H0 : x ∉ free_evars ϕ H : no_positive_occurrence_db_b (S n') ϕ = true
~~
evar_has_positive_occurrence x
ϕ^[svar:S n'↦patt_free_evar x]
now apply IHϕ.
}
Defined .
End subst .
(*
#[export]
Hint Resolve wfc_mu_free_svar_subst : core.
#[export]
Hint Resolve wfc_mu_free_svar_subst : core.
#[export]
Hint Resolve wfc_ex_free_evar_subst_2 : core.
*)